From 845cd763f3b3cac052e333df3559dcc4c9a3383a Mon Sep 17 00:00:00 2001 From: Matt Wang <matt@matthewwang.me> Date: Tue, 13 Dec 2022 11:21:20 -0800 Subject: [PATCH] Removes `favicon.html`, shifts content to `head_custom.html` (#1027) * Removes `favicon.html`, shifts content to `head_custom.html` * explicit callout for custom favicon in customization docs * Cleaner and more consistent documentation (review from @pdmosses) Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com> --- _includes/favicon.html | 1 - _includes/head.html | 2 -- _includes/head_custom.html | 1 + docs/customization.md | 14 +++++++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) delete mode 100644 _includes/favicon.html diff --git a/_includes/favicon.html b/_includes/favicon.html deleted file mode 100644 index c485d4c2..00000000 --- a/_includes/favicon.html +++ /dev/null @@ -1 +0,0 @@ -<link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon"> diff --git a/_includes/head.html b/_includes/head.html index 5129457c..0added66 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -2,8 +2,6 @@ <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> - {% include favicon.html %} - <link rel="stylesheet" href="{{ '/assets/css/just-the-docs-default.css' | relative_url }}"> {% if site.ga_tracking != nil %} diff --git a/_includes/head_custom.html b/_includes/head_custom.html index e69de29b..c485d4c2 100644 --- a/_includes/head_custom.html +++ b/_includes/head_custom.html @@ -0,0 +1 @@ +<link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon"> diff --git a/docs/customization.md b/docs/customization.md index f03d9e31..4a5f872e 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -168,20 +168,28 @@ 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 +### Custom Head and Favicon `_includes/head_custom.html` Any HTML added to this file will be inserted before the closing `<head>` tag. This might include additional `<meta>`, `<link>`, or `<script>` tags. -#### Example +Note that by default, this file has the following contents: + +```html +<link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon"> +``` + +#### Example: Custom Favicon {: .no_toc } To add a custom favicon, create `_includes/head_custom.html` and add: ```html -<link rel="shortcut icon" type="image/png" href="{{site.baseurl}}/path/to/your/favicon.png"> +<link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon"> ``` +If *no favicon* is desired, one needs to have a *blank* `_includes/head_custom.html`. + ### Custom Header `_includes/header_custom.html` -- GitLab