fix favicon on iOS Safari not working

pull/2/head
Septs 2022-12-03 10:11:38 +08:00
parent f9ca8437ea
commit b1bc950cd3
No known key found for this signature in database
GPG Key ID: 65144037AFA516E1
1 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,20 @@
{{- with resources.GetMatch "favicon**" -}}
{{- $image := resources.GetMatch "favicon**" }}
{{- if $image -}}
{{- range slice 192 96 32 16 }}
{{- $format := printf "%[1]dx%[1]d" . }}
{{- with $image.Resize $format }}
<link rel="icon" href="{{ .Permalink }}">
{{- end }}
{{- end }}
<link rel="icon" href="{{ $image.Permalink }}">
{{- range slice 180 167 152 144 120 114 76 72 }}
{{- $format := printf "%[1]dx%[1]d" . }}
{{- with $image.Resize $format }}
<link rel="apple-touch-icon" sizes="{{ $format }}" href="{{ .Permalink }}">
{{- end }}
{{- end }}
<link rel="apple-touch-icon" href="{{ $image.Permalink }}">
{{- end }}
{{- with resources.Get "main.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ .Permalink }}">
{{- end }}