Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vividvilla/ezhil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Chen <travis.chen@everchanging.dev>2019-10-10 02:53:10 +0300
committerTravis Chen <travis.chen@everchanging.dev>2019-10-10 03:00:30 +0300
commitbb85c2b77fe4fb691f6bab9c82366cb24b779eff (patch)
treefd3d1bffd40398e804e932f002c3419ab57b0ce0 /layouts
parent1a6e76206c4e5af8f7b75ab8e6f2fa5c77d408c0 (diff)
feat: allow specifying favicon via configuration
We assume PNG MIME type, because, from my understanding, PNG is the main format for favicons nowadays (even if they have an "ico" extension). Further configuration options are needed to allow for specifying different MIME types.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/header.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 273c6cc..9f8913a 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -9,6 +9,10 @@
<title>{{ $title }} - {{ $siteTitle }}</title>
{{- end -}}
+ {{- if isset .Site.Params "favicon" -}}
+ <link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
+ {{- end -}}
+
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}