Skip to content

fix(seo): leave noindex pages out of the RSS feeds - #2349

Merged
markdumay merged 2 commits into
mainfrom
fix/2346-rss-noindex
Nov 7, 2026
Merged

markdumay merged 2 commits into
mainfrom
fix/2346-rss-noindex

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Summary

The RSS feeds now leave out pages that utilities/IsIndexable.html rejects (robots noindex or none), as sitemap.xml already does. This covers the home, section, taxonomy and term feeds.

  • The limit counts only listed pages. The loop stops at the limit-th indexable page when the limit is 1 or more. It checks each page with partialCached and drops the hidden pages with complement, which avoids a quadratic append.
  • lastBuildDate is 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.
  • An empty-feed fix: a feed with no pages used to emit an invalid, empty <lastBuildDate/>, as the exampleSite's /en/docs/ feed did.

Tests

  • New tests/feeds fixture and scripts/test-feeds.mjs, run as test:feeds in pnpm test and 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.
  • The tests fail 10 of 13 against the old rss.xml and pass 13 of 13 now, on Hugo 0.158 and 0.169.
  • The exampleSite feeds are byte-identical apart from the empty lastBuildDate. All feeds pass xmllint.
  • Blind review: PASS, after one repair.
  • Known test gaps, with correct code: no fixture has an indexable page beyond the limit with a newer lastmod, and no fixture has two noindex pages with the same title.

Follow-up: #2348, where term dates still come from noindex member pages.

Fixes #2346

🤖 Generated with Claude Code

markdumay and others added 2 commits November 7, 2026 12:02
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>
@netlify

netlify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit 4ba34a0
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6aef265f3d869c2ebb895845
😎 Deploy Preview https://deploy-preview-2349--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay
markdumay enabled auto-merge November 7, 2026 13:24
@markdumay
markdumay merged commit f928f72 into main Nov 7, 2026
17 checks passed
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.52.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSS feed lists pages marked noindex

1 participant