diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b3bf94..494e382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +* Possibility of set favicon param, must be svg, git or png ## [v1.0.0] - 2020-04-28 ### Added diff --git a/layouts/partials/header.html b/layouts/partials/header.html index ab274ea..021136b 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -21,8 +21,20 @@ {{ end }} - - + {{ if and (.Site.Params.favicon) (fileExists (print "static/images/" .Site.Params.favicon)) }} + {{ $name := .Site.Params.favicon }} + {{ $splitted := split $name "." }} + {{ $extension := index $splitted 1 }} + {{ if ( in "svg" $extension) }} + + {{ else if (in "gif png" $extension) }} + + {{ end}} + {{ else if (fileExists "static/images/favicon.svg") }} + + {{ else if (fileExists "static/images/favicon.png") }} + + {{ end }} {{ partial "opengraph.html" . }}