Getting Started
Getting Started¶
Install and configure mkdocs-metadata-enricher-plugin in under 2 minutes.
Installation¶
This will also install the required dependency mkdocs-git-revision-date-localized-plugin.
Configuration¶
Add the plugin to your mkdocs.yml. The order matters — the git revision
date plugin must run before the metadata enricher:
plugins:
- search
# Must run BEFORE metadata-enricher to provide git data
- git-revision-date-localized:
type: date
enable_creation_date: false
# Enriches sitemap & search index with git dates
- metadata-enricher:
enrich_sitemap: true
enrich_search: true
search_date_type: datetime
search_locale: en
Build your docs¶
That's it! Your sitemap.xml will now contain accurate <lastmod> dates and
your search index will show when each page was last updated.
Verify it works¶
After building, you can inspect the results:
Sitemap¶
Open site/sitemap.xml and look for <lastmod> entries:
Search index¶
Open site/search/search_index.json and look for dates in the text field of
each entry. With search_date_type: datetime, you'll see something like:
{
"location": "my-page/",
"title": "My Page",
"text": "April 27, 2025 13:11:28 — Page content here..."
}
Next steps¶
- Configuration — customise date formats, timezones, and locales
- How It Works — understand the enrichment pipeline