1+ {{/* Favicon configuration - easily switchable via params */}}
2+ {{ $faviconPath := .Site.Params.faviconPath | default "favicons/default" }}
3+
4+ {{/* Basic favicon */}}
5+ < link rel ="shortcut icon " href ="{{ printf "%s /favicon.ico" $faviconPath | absURL }}" type="image/x-icon ">
6+ < link rel ="icon " href ="{{ printf "%s /favicon.ico" $faviconPath | absURL }}" type="image/x-icon ">
7+
8+ {{/* PNG favicons if they exist */}}
9+ {{ if fileExists (printf "static/%s/favicon-32x32.png" $faviconPath) }}
10+ < link rel ="icon " type ="image/png " sizes ="32x32 " href ="{{ printf "%s /favicon-32x32.png" $faviconPath | absURL }}">
11+ {{ end }}
12+
13+ {{ if fileExists (printf "static/%s/favicon-16x16.png" $faviconPath) }}
14+ < link rel ="icon " type ="image/png " sizes ="16x16 " href ="{{ printf "%s /favicon-16x16.png" $faviconPath | absURL }}">
15+ {{ end }}
16+
17+ {{/* Apple Touch Icon */}}
18+ {{ if fileExists (printf "static/%s/apple-touch-icon.png" $faviconPath) }}
19+ < link rel ="apple-touch-icon " sizes ="180x180 " href ="{{ printf "%s /apple-touch-icon.png" $faviconPath | absURL }}">
20+ {{ end }}
21+
22+ {{/* Android Chrome Icons */}}
23+ {{ if fileExists (printf "static/%s/android-chrome-192x192.png" $faviconPath) }}
24+ < link rel ="icon " type ="image/png " sizes ="192x192 " href ="{{ printf "%s /android-chrome-192x192.png" $faviconPath | absURL }}">
25+ {{ end }}
26+
27+ {{ if fileExists (printf "static/%s/android-chrome-512x512.png" $faviconPath) }}
28+ < link rel ="icon " type ="image/png " sizes ="512x512 " href ="{{ printf "%s /android-chrome-512x512.png" $faviconPath | absURL }}">
29+ {{ end }}
30+
31+ {{/* Web Manifest */}}
32+ {{ if fileExists (printf "static/%s/site.webmanifest" $faviconPath) }}
33+ < link rel ="manifest " href ="{{ printf "%s /site.webmanifest" $faviconPath | absURL }}">
34+ {{ end }}
35+
36+ {{/* Safari Pinned Tab */}}
37+ {{ if fileExists (printf "static/%s/safari-pinned-tab.svg" $faviconPath) }}
38+ < link rel ="mask-icon " href ="{{ printf "%s /safari-pinned-tab.svg" $faviconPath | absURL }}" color="{{ .Site.Params.safariPinnedTabColor | default "#011F5B " }}">
39+ {{ end }}
40+
41+ {{/* Microsoft Tile */}}
42+ {{ if .Site.Params.msapplicationTileColor }}
43+ < meta name ="msapplication-TileColor " content ="{{ .Site.Params.msapplicationTileColor }} ">
44+ {{ end }}
45+
46+ {{/* Theme Color */}}
47+ < meta name ="theme-color " content ="{{ .Site.Params.themeColor | default "#011F5B " }}">
0 commit comments