diff options
author | Maahir Ur Rahman <msmaahirur@gmail.com> | 2024-08-20 08:22:05 +0700 |
---|---|---|
committer | Maahir Ur Rahman <msmaahirur@gmail.com> | 2024-08-21 07:53:04 +0700 |
commit | 9206be4e464af527355be03852b487ae6f600697 (patch) | |
tree | 1e231bc80dbac734c0c8ea40daae2e9135c2736d | |
parent | ef055ec50d07a7f764d1ee8aaabcebf209bc6b6e (diff) |
feat(partials): allow setting of favicon path
chore(partials): add explicit links for all favicon types
-rw-r--r-- | layouts/partials/head.html | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 482d7e9..b7b943f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,14 +1,24 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> +{{ $faviconPath := (.Site.Params.faviconPath | default "" | absURL) }} + +<link rel="icon" type="image/ico" href="{{ $faviconPath }}/favicon.ico"> +<link rel="icon" type="image/ico" href="{{ $faviconPath }}/favicon.ico"> +<link rel="icon" type="image/png" sizes="16x16" href="{{ $faviconPath }}/favicon-16x16.png"> +<link rel="icon" type="image/png" sizes="32x32" href="{{ $faviconPath }}/favicon-32x32.png"> +<link rel="icon" type="image/png" sizes="192x192" href="{{ $faviconPath }}/android-chrome-192x192.png"> +<link rel="apple-touch-icon" sizes="180x180" href="{{ $faviconPath }}/apple-touch-icon.png"> + {{ with .OutputFormats.Get "rss" -}} - {{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} +{{ printf ` +<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} {{ end }} {{- if .IsHome -}} -<meta name="description" content="{{ site.Params.Description }}" /> +<meta name="description" content="{{ site.Params.Description }}"/> {{- else -}} -<meta name="description" content="{{ .Params.Description }}" /> +<meta name="description" content="{{ .Params.Description }}"/> {{- end }} <title> @@ -19,7 +29,7 @@ {{ end }} </title> -<link rel="canonical" href="{{ .Permalink }}" /> +<link rel="canonical" href="{{ .Permalink }}"/> {{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }} @@ -29,5 +39,5 @@ {{ end }} {{ if .Site.Params.umami.enable }} - {{ partial "umami.html" . }} -{{ end }}
\ No newline at end of file +{{ partial "umami.html" . }} +{{ end }} |