From 1ec08b42ddfa2e3fa1a660197ac2ba56677e0ad5 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 27 Jul 2020 17:52:38 +0200 Subject: [PATCH] Fixed site title behavior when using front matter --- docs/getting-started.md | 2 +- docs/reference/meta-tags.md | 5 ++--- material/base.html | 2 +- src/base.html | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 9a3750505..991089269 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,6 +1,6 @@ --- template: overrides/main.html -title: Getting started - Material for MkDocs +title: Getting started --- # Getting started diff --git a/docs/reference/meta-tags.md b/docs/reference/meta-tags.md index 302bfcc7f..4665cb1da 100644 --- a/docs/reference/meta-tags.md +++ b/docs/reference/meta-tags.md @@ -45,9 +45,8 @@ title: Lorem ipsum dolor sit amet ``` This will set the `title` tag inside the document `head` for the current page -to the provided value. It will also override the default behavior of Material -for MkDocs which appends the site title using a dash as a separator to the page -title. +to the provided value. Note that the site title is appended using a dash as a +separator, which is the default behavior. [5]: #metadata diff --git a/material/base.html b/material/base.html index 8d1d9a072..a6701cb09 100644 --- a/material/base.html +++ b/material/base.html @@ -33,7 +33,7 @@ {% endblock %} {% block htmltitle %} {% if page and page.meta and page.meta.title %} - {{ page.meta.title }} + {{ page.meta.title }} - {{ config.site_name }} {% elif page and page.title and not page.is_homepage %} {{ page.title | striptags }} - {{ config.site_name }} {% else %} diff --git a/src/base.html b/src/base.html index b66576d8a..ff5e6a67c 100644 --- a/src/base.html +++ b/src/base.html @@ -80,7 +80,7 @@ {% block htmltitle %} {% if page and page.meta and page.meta.title %} - {{ page.meta.title }} + {{ page.meta.title }} - {{ config.site_name }} {% elif page and page.title and not page.is_homepage %} {{ page.title | striptags }} - {{ config.site_name }} {% else %}