mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed site title behavior when using front matter
This commit is contained in:
parent
af4f74b368
commit
1ec08b42dd
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
template: overrides/main.html
|
template: overrides/main.html
|
||||||
title: Getting started - Material for MkDocs
|
title: Getting started
|
||||||
---
|
---
|
||||||
|
|
||||||
# Getting started
|
# Getting started
|
||||||
|
@ -45,9 +45,8 @@ title: Lorem ipsum dolor sit amet
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will set the `title` tag inside the document `head` for the current page
|
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
|
to the provided value. Note that the site title is appended using a dash as a
|
||||||
for MkDocs which appends the site title using a dash as a separator to the page
|
separator, which is the default behavior.
|
||||||
title.
|
|
||||||
|
|
||||||
[5]: #metadata
|
[5]: #metadata
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block htmltitle %}
|
{% block htmltitle %}
|
||||||
{% if page and page.meta and page.meta.title %}
|
{% if page and page.meta and page.meta.title %}
|
||||||
<title>{{ page.meta.title }}</title>
|
<title>{{ page.meta.title }} - {{ config.site_name }}</title>
|
||||||
{% elif page and page.title and not page.is_homepage %}
|
{% elif page and page.title and not page.is_homepage %}
|
||||||
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
|
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
<!-- Site title -->
|
<!-- Site title -->
|
||||||
{% block htmltitle %}
|
{% block htmltitle %}
|
||||||
{% if page and page.meta and page.meta.title %}
|
{% if page and page.meta and page.meta.title %}
|
||||||
<title>{{ page.meta.title }}</title>
|
<title>{{ page.meta.title }} - {{ config.site_name }}</title>
|
||||||
{% elif page and page.title and not page.is_homepage %}
|
{% elif page and page.title and not page.is_homepage %}
|
||||||
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
|
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
Loading…
Reference in New Issue
Block a user