Added support for meta keywords (#2029)

* Update mkdocs.yml

* Update base.html
This commit is contained in:
Writeup 2020-11-06 04:07:35 +08:00 committed by GitHub
parent ab5aa84cbb
commit 6608f3a439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,7 @@
site_name: Material for MkDocs
site_url: https://squidfunk.github.io/mkdocs-material/
site_author: Martin Donath
site_keywords: Material,MkDocs
site_description: >-
Create a branded static site from a set of Markdown files to host the
documentation of your Open Source or commercial project customizable,

View File

@ -31,6 +31,13 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<!-- Page keywords -->
{% if page and page.meta and page.meta.keywords %}
<meta name="keywords" content="{{ page.meta.keywords }}" />
{% elif config.site_keywords %}
<meta name="keywords" content="{{ config.site_keywords }}" />
{% endif %}
<!-- Page description -->
{% if page and page.meta and page.meta.description %}
<meta name="description" content="{{ page.meta.description }}" />