From 7cabda298352f61b3f6207c93c79962959923fde Mon Sep 17 00:00:00 2001 From: Peter Mosses <18308236+pdmosses@users.noreply.github.com> Date: Tue, 27 Dec 2022 22:09:47 +0100 Subject: [PATCH] Restore simple configuration of favicon.ico (#1095) Avoid the need to add a link to favicon,ico when editing `_includes/head_custom.html`, and avoid creating an invalid favicon link - Remove the content of `_includes/head_custom.html` - Add code to `_includes/head.html` to create a link to an existing favicon,ico - Add an explanation of favicon_ico to docs/configuration.md - Remove the example of `includes/head_custom.html` and add an explanation of what the `` element automatically includes --- _includes/head.html | 9 +++++++++ _includes/head_custom.html | 1 - docs/configuration.md | 9 +++++++++ docs/customization.md | 25 ++----------------------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index f71e7ea..5a6c877 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -29,6 +29,15 @@ + + {% for file in site.static_files %} + {% if file.path == site.favicon_ico or file.path == '/favicon.ico' %} + {% assign favicon = true %} + {% endif %} + {% endfor %} + {% if favicon %} + + {% endif %} {% seo %} diff --git a/_includes/head_custom.html b/_includes/head_custom.html index c485d4c..e69de29 100644 --- a/_includes/head_custom.html +++ b/_includes/head_custom.html @@ -1 +0,0 @@ - diff --git a/docs/configuration.md b/docs/configuration.md index 6892ba4..d7ff5de 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -27,6 +27,15 @@ View this site's [\_config.yml](https://github.com/just-the-docs/just-the-docs/t logo: "/assets/images/just-the-docs.png" ``` +## Site favicon + +```yaml +# Set a path/url to a favicon that will be displayed by the browser +favicon_ico: "/assets/images/favicon.ico" +``` + +If the path to your favicon is `/favicon.ico`, you can leave `favicon_ico` unset. + ## Search ```yaml diff --git a/docs/customization.md b/docs/customization.md index ca3cfec..67070ae 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -167,34 +167,13 @@ The (optional) `text-delta` class makes the heading appear as **Contents**{:.tex This content appears at the bottom of every page's main content. More info for this include can be found in the [Configuration - Footer content]({{ site.baseurl }}{% link docs/configuration.md %}#footer-content). -### Custom Head and Favicon +### Custom Head `_includes/head_custom.html` Any HTML added to this file will be inserted before the closing `` tag. This might include additional ``, ``, or `