diff options
author | Julio Pescador <jpescador@users.noreply.github.com> | 2016-03-06 00:32:07 +0300 |
---|---|---|
committer | Julio Pescador <jpescador@users.noreply.github.com> | 2016-03-06 00:39:39 +0300 |
commit | 4c2aad59092966eab23d6bbeebb8c0d7fb3be9e3 (patch) | |
tree | 7d964c8957e6475ccfa8d4809256d342e57db3bc | |
parent | 5a02abeefa47081c61264ba810b49acf13cf9478 (diff) |
Creating favicon partial templatev0.166
This template is used in the header template. The set of favicons used
are based on the write-up from this link:
https://github.com/audreyr/favicon-cheat-sheet
Two new site params are created to load the favicon and load an update
to the favicon by versioning:
[params]
loadFavicon = boolean
faviconVersion = String value of the version which will append
to the end of the filename before the extension
-rw-r--r-- | layouts/partials/favicon.html | 18 | ||||
-rw-r--r-- | layouts/partials/header.html | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html new file mode 100644 index 0000000..47ddd20 --- /dev/null +++ b/layouts/partials/favicon.html @@ -0,0 +1,18 @@ +{{ if .Site.Params.loadFavicon }} + {{ with .Site.Params.faviconVersion }} + {{ $.Scratch.Set "favVer" "-" }} + {{ $.Scratch.Add "favVer" . }} + {{ else }} + {{ $.Scratch.Set "favVer" "" }} + {{ end }} + + {{ $favVer := $.Scratch.Get "favVer" }} + + <link rel="apple-touch-icon-precomposed" + href='/favicon/apple-touch-icon-precomposed{{ $favVer }}.png'> + <link rel="icon" href='/favicon/favicon{{ $favVer }}.png'> + <!--[if IE]><link rel="shortcut icon" href='/favicon{{ $favVer }}.ico'><![endif]--> + <meta name="msapplication-TileColor" content="#da532c"> + <meta name="msapplication-TileImage" + content='/favicon/mstile{{ $favVer }}.png'> +{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 273bef3..11c47f8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -19,6 +19,8 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> {{ .Hugo.Generator }} + {{ partial "favicon" . }} + {{ with .Params.author }} <meta name="author" content="{{ . }}"> {{ end }} |