feat(seo): add lastmod to static sitemap listing pages (#1324)#1334
Merged
Conversation
The per-object sitemaps (projects/people/news) already emit <lastmod>, but the static listing pages (home, people, publications, projects, awards, news) had none. Source each from its section's most-recent content date so crawlers get a re-crawl signal for the listings too. Empty sections omit <lastmod>. Closes the "sitemap lastmod completeness polish" item from #1324. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
<lastmod>to the static listing pages in the sitemap (home, people, publications, projects, awards, news). The per-object sitemaps (projects/people/news) already emitted<lastmod>; the listing pages did not, so crawlers got no re-crawl signal for the listings.Each listing's
lastmodis sourced from its section's most-recent content date:Person.bio_datetime_modifiedPublication.dateProject.updatedAward.dateNews.dateEmpty sections return
None, so the framework simply omits<lastmod>for them. Mixed date/datetime across sections is safe — Django'sget_latest_lastmodcatches the mixed-typemax()and drops only the sitemap-index lastmod.Why
Closes the "sitemap
lastmodcompleteness polish" item from #1324. This is the last concrete on-page-SEO task in that issue; see #1324 for the full wrap-up (theScholarlyArticleJSON-LD item is being dropped, and theSECURE_PROXY_SSL_HEADERfollow-up lives in #1329).Test
Added
test_static_listing_pages_have_lastmodtowebsite/tests/test_sitemap.py. Full sitemap suite passes (8 tests):No UI changes (XML output only), so no a11y/screenshot impact.
Refs #1324
🤖 Generated with Claude Code