Skip to content

Commit

Permalink
fix(favicons): do not copy the resources to correct the broken links …
Browse files Browse the repository at this point in the history
…on multiple domains (#19)
  • Loading branch information
razonyang committed Nov 1, 2023
1 parent c68015f commit 39621cb
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -10,7 +10,7 @@
{{- end }}
{{/* SVG icon. */}}
{{- with resources.Get (default "favicon.svg" .Site.Params.seo.favicons.svg_icon) }}
{{- $svg := . | resources.Copy ("/favicon.svg" | relURL) }}
{{- $svg := . }}
<link rel="icon" href="{{ $svg.RelPermalink }}" type="{{ .MediaType.Type }}">
{{- end }}
{{- $faviconName := default "favicon.png" .Site.Params.seo.favicons.icon }}
Expand All @@ -24,7 +24,7 @@
{{- range $sizes }}
{{- $iconName := printf "/favicon-%s" .size }}
{{- with .rel }}{{ $iconName = . }}{{ end }}
{{- $img := $favicon.Resize .size | resources.Copy (printf "%s%s" $iconName (path.Ext $favicon.Name) | relURL) }}
{{- $img := $favicon.Resize .size }}
<link
rel="{{ default `icon` .rel }}"
href="{{ $img.RelPermalink }}"
Expand All @@ -39,7 +39,7 @@
{{/* Mask (Pinned Tab) icon for Safari browser. */}}
{{- $maskIcon := default "mask-icon.svg" .Site.Params.seo.favicons.mask_icon }}
{{- with resources.Get $maskIcon }}
{{- $mask := . | resources.Copy ("/mask-icon.svg" | relURL) }}
{{- $mask := . }}
<link
rel="mask-icon"
href="{{ $mask.RelPermalink }}"
Expand Down

0 comments on commit 39621cb

Please sign in to comment.