From 8476bd0160bb19d6b46e49bb9c065ed7f32f30c4 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 23 Aug 2020 11:32:53 +0200 Subject: [PATCH] feat(head): add favicon support --- exampleSite/config.toml | 1 + layouts/partials/head.html | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 47c4e73..7fd1e1b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -9,6 +9,7 @@ paginate = 5 avatar = "img/avatar.jpg" subtitle = "和世界分享刚编的破事" postLicense = "Licenced under CC BY-NC-SA 4.0" + favicon = "" [params.widgets] enabled = ['archive', 'tag-cloud'] [params.widgets.tagCloud] diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6543065..babb16e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -15,4 +15,10 @@ {{ range .AlternativeOutputFormats -}} {{ end -}} + + {{- if .Site.Params.favicon -}} + {{- $logo := resources.Get .Site.Params.favicon -}} + {{- $favicon := $logo.Resize "32x" -}} + + {{- end -}} \ No newline at end of file