Skip to content

Add <meta name=Date for SEO using mkdocs-git-revision-date-localized-plugin #5339

Answered by kamilkrzyskow
xsa asked this question in Q&A
Discussion options

You must be logged in to vote
{%- 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:

{% if page.meta.git_revision_date_localized %}

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…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@xsa
Comment options

Comment options

You must be logged in to vote
2 replies
@xsa
Comment options

@kamilkrzyskow
Comment options

Answer selected by xsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants