New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sitemap): add support for "lastmod" #9954
Conversation
remove now useless /404.html edge case handling
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: +45 B (0%) Total Size: 992 kB
ℹ️ View Unchanged
|
…orber/sitemap-lastmod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent work; I like that you're looking to make the default sitemap include lastmod
by default with Docusaurus v4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Thanks for the review 🙏
Is it expected, that lastmod is always today? (might be date of last deploy) See https://docs.flathub.org/sitemap.xml |
@razzeee you need to configure your CI to fetch the full git history. |
You may need: - name: Checkout 📥
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
fetch-depth: 0
submodules: true |
Thanks, working now |
I've now got around to trying the released version.
To make the logic in
|
Thanks @pmarschik , I adopted both solutions at once in #10022
Not sure what you mean here |
@slorber Thanks for the quick fix. I meant exactly what you merged in #10022. Except with multiline I meant the RegExp could be |
ah I see thanks, just a different way to express the same thing I guess (and yours look better 😅 ) |
Motivation
Fix #2604
Add new sitemap options:
lastmod
that permits to output<lastmod>
tags in the sitemap, formatted asYYYY-MM-DD
date, or ISO datetime<changefreq>
and<priority>
sitemap tags (Google doesn't use them) withnull
valuesImportant notes:
lastmod
only works for routes backed and requires plugin authors to add new route metadata when callingaddRoute()
<lastmod>
tag for React page components as well. However it will only use the React page source Git history, and will not check history of its dependencies.<lastmod>
tag. If a third-party plugin does not provide the new metadata, the sitemap can't infer a proper value. According to Google recommendations, it's only relevant to use<lastmod>
tags for routes backed by content, and not routes aggregating multiple documents (tags, blog pagination, blog archive, doc autogenerated index...)Test Plan
Unit tests + dogfood on our website
Test links
Related issues/PRs
Supersed PR #9234