fix: check if favicon exists before accessing permalink (#1259)

This commit is contained in:
Jimmy
2026-02-01 13:11:42 +01:00
committed by GitHub
parent 768e7de697
commit 7f47cdf165
+3 -3
View File
@@ -18,9 +18,9 @@
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{- end -}} {{- end -}}
{{ with .Site.Params.favicon }} {{- $favicon := partial "helper/image" (dict "Image" .Site.Params.favicon "Resources" resources) -}}
{{- $favicon := partial "helper/image" (dict "Image" . "Resources" resources) -}} {{ with $favicon }}
<link rel="shortcut icon" href="{{ $favicon.Permalink }}" /> <link rel="shortcut icon" href="{{ .Permalink }}" />
{{ end }} {{ end }}
{{- partial "google_analytics.html" . -}} {{- partial "google_analytics.html" . -}}