diff --git a/exampleSite/content/basics/customization/_index.en.md b/exampleSite/content/basics/customization/_index.en.md index b9dab230de..a31df5031e 100644 --- a/exampleSite/content/basics/customization/_index.en.md +++ b/exampleSite/content/basics/customization/_index.en.md @@ -35,12 +35,14 @@ The size of the logo will adapt automatically ## Change the favicon -If your favicon is a png, just drop off your image in your local `static/images/` folder and name it `favicon.png` +If your favicon is a SVG, PNG or ICO, just drop off your image in your local `static/images/` folder and name it `favicon.svg`, `favicon.png` or `favicon.ico` respectivly. + +If no favicon file is found, the theme will lookup the alternative filename `logo` in the same location and will repeat the search for the list of supported file types. If you need to change this default behavior, create a new file in `layouts/partials/` named `favicon.html`. Then write something like this: ```html - + ``` ## Change default colors {#theme-variant} diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index 35a0666068..14a2f2ac94 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -13,6 +13,10 @@ This document shows you what's new in the latest release. For a detailed list of --- +## 2.8.0 + +- **New**: The theme now supports favicons served from `static/images/` named as `favicon` or `logo` in SVG, PNG or ICO format [out of the box]({{% relref "basics/customization/#change-the-favicon" %}}). An overridden partial `layouts/partials/favicon.html` may not be necessary anymore in most cases. + ## 2.7.0 - **New**: Optional second parameter for [`notice`]({{% relref "shortcodes/notice" %}}) shortcode to set title in box header. diff --git a/exampleSite/layouts/partials/favicon.html b/exampleSite/layouts/partials/favicon.html deleted file mode 100644 index 48b528d2a0..0000000000 --- a/exampleSite/layouts/partials/favicon.html +++ /dev/null @@ -1,2 +0,0 @@ -{{- $assetBusting := not .Site.Params.disableAssetsBusting -}} - \ No newline at end of file diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html index b47de9fde5..a975acef26 100644 --- a/layouts/partials/favicon.html +++ b/layouts/partials/favicon.html @@ -1 +1,14 @@ - \ No newline at end of file +{{- $assetBusting := not .Site.Params.disableAssetsBusting -}} +{{- if (fileExists "/static/images/favicon.svg") }} + +{{- else if (fileExists "/static/images/favicon.png") }} + +{{- else if (fileExists "/static/images/favicon.ico") }} + +{{- else if (fileExists "/static/images/logo.svg") }} + +{{- else if (fileExists "/static/images/logo.png") }} + +{{- else if (fileExists "/static/images/logo.ico") }} + +{{- end }} \ No newline at end of file