Add <meta name=Date for SEO using mkdocs-git-revision-date-localized-plugin #5339
-
Hi everyone, I'm looking to leverage the mkdocs-git-revision-date-localized-plugin to add the Date Been trying by adding the below to my
Thanks in advance. -X. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Did you set up theme extension, i.e. |
Beta Was this translation helpful? Give feedback.
-
{%- block extrahead -%}
{%- if page.meta and page.meta.git_revision_date_localized -%}
<meta name="Date" scheme="iso8601" content="{{ page.meta.git_revision_date_localized_raw_iso_date }}">
{%- endif -%}
{%- endblock -%} Like you said in the response to squidfunk, the Last Update date appears, so I checked how the theme handles it: but this contained a HTML tag, and the raw date string was needed, so I checked how the plugin stores the luckily it does provide raw strings to the date. The final result looked like this: <meta name="Date" scheme="iso8601" content="2023-02-26"> However, doing a quick search online, I'm not sure whether or not the |
Beta Was this translation helpful? Give feedback.
Like you said in the response to squidfunk, the Last Update date appears, so I checked how the theme handles it:
mkdocs-material/src/partials/source-file.html
Line 29 in 958a8e0
but this contained a HTML tag, and the raw date string was needed, so I checked how the plugin stores the
meta
variables:https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/6150fad41a83abbf7500c…