Closed lemonicy closed 4 months ago
VitePress Doc - Last Updated - Frontmatter Config
This can be disabled per-page using the lastUpdated option on frontmatter:
--- lastUpdated: false ---
I don't mean to disable lastUpdated option.
I have written some codes to solve this issue. The solution has been added to the main post.
Describe the bug
When generating sitemap, the lastmod attribute only uses the commit time in git log, but not lastUpdated value in frontmatter.
Reproduction
No need to add any templates.
Expected behavior
If the frontmatter contains lastUpdated key, generated sitemap should use the lastUpdated value, otherwise use the commit time in git log.
I remember the behavior was right in RC versions, not very sure.
System Info
Additional context
No response
Validations
Solution (Added in 3rd June 2024)
I wrote some codes to solve this issue, maybe I can help others who searched from google.
in config.mjs or config.mts: