Instruction file imported from michaelgainford/michaelgainford.github.io (
.github/instructions/sitemap-update.instructions.md). Copyright stays with the author.
Sitemap Date Update
Whenever a page file under app/ is created or modified, update the sitemap dates for that route.
Sitemap Files
There are two files to keep in sync:
public/sitemap.xml— update the<lastmod>value for the matching<loc>.- Format:
YYYY-MM-DDTHH:MM:SS+00:00 - Example:
2026-05-09T00:00:00+00:00
- Format:
data/data_for__sitemap.json— update thelastUpdatedvalue for the matching entry.- Format:
YYYY-MM-DD - Example:
2026-05-09
- Format:
How to Match Routes
Map the changed file path to the live URL:
| File path | Route URL |
|---|---|
app/page.jsx |
https://michaelgainford.dev/ |
app/projects/page.jsx |
https://michaelgainford.dev/projects |
app/projects/space/page.jsx |
https://michaelgainford.dev/projects/space |
Use the same pattern for any nested route.
Steps
- Identify the route(s) affected by the file change.
- Update
<lastmod>inpublic/sitemap.xmlfor each affected<loc>. - Update
lastUpdatedindata/data_for__sitemap.jsonfor each matching entry. - Use today's date for both values.
Notes
- If a new page is added and has no sitemap entry yet, add one to both files.
- If the changed file affects a parent route (e.g. shared layout or data), update the parent route entry too.
- Do not update entries for routes you did not change.