From 8b8177e5c8fe52d756f533ad23c1bf4db98e905c Mon Sep 17 00:00:00 2001 From: Shangzhi Huang Date: Mon, 17 Feb 2020 22:36:14 +0800 Subject: [PATCH] Rename favicons.html to custom-head.html (#468) Merge pull request 468 --- README.md | 7 +++++-- _includes/custom-head.html | 6 ++++++ _includes/favicons.html | 6 ------ _includes/head.html | 4 +++- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 _includes/custom-head.html delete mode 100644 _includes/favicons.html diff --git a/README.md b/README.md index 00f7a715e1..bbbfe72b1e 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Refers to snippets of code within the `_includes` directory that can be inserted - `footer.html` — Defines the site's footer section. - `google-analytics.html` — Inserts Google Analytics module (active only in production environment). - `head.html` — Code-block that defines the `` in *default* layout. + - `custom-head.html` — Placeholder to allow users to add more metadata to ``. - `header.html` — Defines the site's main header section. By default, pages with a defined `title` attribute will have links displayed here. - `social.html` — Renders social-media icons based on the `minima:social_links` data in the config file. @@ -184,10 +185,12 @@ minima: ``` -### Add your favicons +### Extending the `` + +You can *add* custom metadata to the `` of your layouts by creating a file `_includes/custom-head.html` in your source directory. For example, to add favicons: 1. Head over to [https://realfavicongenerator.net/](https://realfavicongenerator.net/) to add your own favicons. -2. [Customize](#customization) default `_includes/favicons.html` in your source directory and insert the given code snippet. +2. [Customize](#customization) default `_includes/custom-head.html` in your source directory and insert the given code snippet. ### Enabling comments (via Disqus) diff --git a/_includes/custom-head.html b/_includes/custom-head.html new file mode 100644 index 0000000000..8559a67ffa --- /dev/null +++ b/_includes/custom-head.html @@ -0,0 +1,6 @@ +{% comment %} + Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons: + + 1. Head over to https://realfavicongenerator.net/ to add your own favicons. + 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet. +{% endcomment %} diff --git a/_includes/favicons.html b/_includes/favicons.html deleted file mode 100644 index e821726aca..0000000000 --- a/_includes/favicons.html +++ /dev/null @@ -1,6 +0,0 @@ -{% comment %} - Placeholder to allow defining custom favicons - - 1. Head over to https://realfavicongenerator.net/ to add your own favicons. - 2. Customize default _includes/favicons.html in your source directory and insert the given code snippet. -{% endcomment %} diff --git a/_includes/head.html b/_includes/head.html index 1c424432f4..9ee139f2a9 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -2,11 +2,13 @@ - {%- include favicons.html -%} {%- seo -%} {%- feed_meta -%} {%- if jekyll.environment == 'production' and site.google_analytics -%} {%- include google-analytics.html -%} {%- endif -%} + + {%- include custom-head.html -%} +