diff --git a/README.md b/README.md index 69233eb..af430af 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,12 @@ Use [RealFaviconGenerator](https://realfavicongenerator.net/) to generate these * safari-pinned-tab.svg * site.webmanifest -If your favicon source is in the svg format, save it as `assets/images/favicon.svg` to enable svg favicon for supported browsers. +#### SVG Favicons + +If your favicon is in SVG format, there are two ways to implement the same in this theme. + +* If you are looking for a clean directory structure, place your favicon as `favicon.svg` in `static` directory. **In this mode, favicon will not be minified by Hugo** +* If you want your generated site to be as light as possible, place your favicon as `favicon.svg` in `assets/images`. **In this mode, favicon will be minified by Hugo** ### Social icons diff --git a/layouts/partials/site-meta.html b/layouts/partials/site-meta.html index 02f62b5..190bde6 100644 --- a/layouts/partials/site-meta.html +++ b/layouts/partials/site-meta.html @@ -2,12 +2,16 @@ +{{- if (not (in .Page.RelPermalink "404")) -}} +{{- else -}} + +{{- end -}} {{- if (fileExists "static/favicon.ico") -}} - + {{- end -}} {{ $favicon := "images/favicon.svg" }} {{- if (fileExists (printf "assets/%s" $favicon)) -}}