Open thesuperzapper opened 11 months ago
It's a cool trick, thanks for sharing!
I don't feel that plugin should also do (automatic) overrides. I also don't want to mess with the sitemap, as mkdocs
is responsible for generating it & I would need to read tests for making sure things don't break in the future.
I will add your example to the documentation however (with reference).
@timvink go ahead, I think it will help lots of people!
Just remember to warn people that if the user has set the plugin's timezone
it might need to be slightly different.
I am currently using this plugin to fix the
lastmod
dates on thesitemap.xml
because MkDocs does not correctly generate thelastmod
, as it uses the build time of the site for ALL pages.Having correct
lastmod
is important for SEO, as it indicates to Search engines when to re-index pages, see this blog from Bing.With
git-revision-date-localized-plugin
, I am able to use thegit_revision_date_localized_raw_iso_datetime
variable (with a few string formatting filters) to give a correct timestamp that actually reflects the last content update of each page.Here is the
sitemap.xml
theme override I am using:NOTE: if @timvink wants to make this a first-party part of the plugin, please go ahead, but I recommend getting the user's
timezone
setting, instead of assuming its in UTC, like above.