Repository navigation
fix(seo): leave noindex pages out of the RSS feeds - #2349
Merged
Merged
Conversation
layouts/rss.xml now drops every page that utilities/IsIndexable.html rejects, as layouts/sitemap.xml does, before the RSS limit applies, so the limit counts only the pages a feed lists. lastBuildDate is read from those pages and is left out when there are none. Before, a feed without pages carried an empty lastBuildDate element, as the exampleSite's /en/docs/ feed did. scripts/test-feeds.mjs builds the new tests/feeds fixture and checks the home, section, taxonomy and term feeds. It runs as test:feeds, in the test script and in the CI build command. Fixes #2346 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
layouts/rss.xml guarded lastBuildDate with the feed's own date, which Hugo can take from a noindex page. A section whose only dated page was noindex, next to an undated indexable page, got lastBuildDate Mon, 01 Jan 0001. The value is now the newest lastmod of the listed pages, and the element is left out when that is zero. The check on the feed's own date stays, as in Hugo's embedded template, so a feed that Hugo leaves undated still has no lastBuildDate. The feed now walks its pages in order and stops at the limit-th indexable one, checks each page with partialCached, and drops the noindex pages it saw with complement, instead of appending every kept page to a slice, which copies the slice on each append. tests/feeds gains a mixed section, a section with a lastmod of its own, a noindex page that shares its title with an indexable one, and a Dutch site without a limit whose pages are noindex unless they say otherwise. Refs #2346 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
markdumay
enabled auto-merge
November 7, 2026 13:24
Collaborator
Author
|
🎉 This PR is included in version 3.52.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
The RSS feeds now leave out pages that
utilities/IsIndexable.htmlrejects (robotsnoindexornone), assitemap.xmlalready does. This covers the home, section, taxonomy and term feeds.partialCachedand drops the hidden pages withcomplement, which avoids a quadraticappend.lastBuildDateis the newest lastmod of the listed pages. It's left out when there are none, when that lastmod is zero, or, as in Hugo's embedded template, when the feed's own date is zero.<lastBuildDate/>, as the exampleSite's/en/docs/feed did.Tests
tests/feedsfixture andscripts/test-feeds.mjs, run astest:feedsinpnpm testand in CI. They cover noindex in every form (case, list,meta.robots,none), the limit, empty feeds, a mixed section whose only dated page is noindex, and a Dutch site with no limit.rss.xmland pass 13 of 13 now, on Hugo 0.158 and 0.169.lastBuildDate. All feeds passxmllint.Follow-up: #2348, where term dates still come from noindex member pages.
Fixes #2346
🤖 Generated with Claude Code