fix(blog): make RSS feed discoverable site-wide#262
Conversation
The RSS autodiscovery <link> only lived on the blog index and post pages, so a feed reader pointed at the root domain (postguard.eu) or any other marketing page found no feed. Move the autodiscovery link into the marketing layout head so every public page advertises the feed, and drop the now-redundant per-page duplicate on /blog/. Refs encryption4all/postguard-business#58 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict is request-changes — posted as COMMENT only because GitHub blocks self-request-changes on a bot-authored PR. Treat the blocker below as blocking.
Rules + review consolidation (cycle 1). The core change is correct: the prerendered output was built and verified to have exactly one application/rss+xml link per page (homepage, /about/, /blog/, and post pages), so there is no duplicate-<link> bug, and npm run check / npm run lint pass.
Blocker — missing regression test on a fix PR. Standing rule (per Ruben: "add some tests" on every fix) is that a fix(...) PR pins the new behaviour with a test. The PR body says "No Playwright tests exist in the repo (0 discovered)", but the repo does ship a configured Playwright harness: playwright.config.ts, npm run test → playwright test, and tests/test.ts. Please:
- Add a short Playwright spec asserting the behaviour from your own before/after table:
link[rel="alternate"][type="application/rss+xml"]is present on/and/about/, and present exactly once on/blog/and a post page. - Fix or remove the existing
tests/test.ts— it is the stale SvelteKit skeleton (expect h1 === 'Welcome to SvelteKit') and no longer matches the homepage, sonpm run testwould not be green. - Correct the "no Playwright tests exist" line in the PR body.
One optional, non-blocking nit inline.
| }) | ||
| </script> | ||
|
|
||
| <svelte:head> |
There was a problem hiding this comment.
Good call making the layout the single source of truth for RSS autodiscovery. One leftover for consistency: src/routes/(marketing)/blog/[slug]/+page.svelte (~line 67) still carries the identical <svelte:head> RSS block you removed from blog/+page.svelte. It's not a duplicate-render bug — Svelte dedupes identical svelte:head elements, and the prerendered output was verified to have exactly one rss link per page — but removing it here too keeps this layout as the only source. Optional, non-blocking.
Replace the leftover SvelteKit skeleton test (asserted h1 === "Welcome to SvelteKit", which never matched this site) with a regression test for the site-wide RSS autodiscovery link: it asserts the <link rel="alternate" type="application/rss+xml"> is present exactly once on /, /about/, /blog/, and a blog post page. Also remove the now-redundant per-page RSS <svelte:head> block from the blog post page — the marketing layout now provides the link site-wide, so the per-page copy produced a duplicate on post pages. Gitignore/prettierignore the Playwright artifact directories so the test run leaves the tree clean. Refs encryption4all/postguard-business#58 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict: APPROVE-equivalent — posted as COMMENT because GitHub blocks a bot from formally approving its own PR. Treat this as sign-off; no changes required.
Rules + review consolidation (cycle 2). All three cycle-1 blockers are resolved:
- ✅ Regression test added —
tests/rss-autodiscovery.test.tsasserts theapplication/rss+xmlautodiscovery link is present exactly once on/,/about/,/blog/, and a blog post page. - ✅ Stale skeleton test removed —
tests/test.ts(theexpect h1 === 'Welcome to SvelteKit'placeholder) is deleted. - ✅ PR body corrected — no longer claims "no Playwright tests exist".
Re-verified locally: build OK, svelte-check 0 errors, lint clean, Playwright 4/4 green; prerendered HTML confirms exactly one RSS autodiscovery <link> per page (no duplicates). The per-rule compliance sweep is clean — the core change (link moved to the marketing layout head, per-page duplicates removed) is correct.
One non-blocking note (not actionable here — do not block on it): the new Playwright spec only runs locally. .github/workflows/ci.yml has no npm run test job, so this regression isn't guarded in CI. The bot can't push workflow changes (lacks the workflows permission), so wiring up the CI test job is a maintainer follow-up. Already disclosed in the PR body. Not a code defect.
Also flipped this PR from draft → ready-for-review (CI green, change is confident).
What
Move the RSS autodiscovery
<link rel="alternate" type="application/rss+xml">from the blog pages into the marketing layout head, so every public page — including the root domainpostguard.eu— advertises the blog feed. Removes the now-redundant per-page duplicate on/blog/and on individual blog post pages.Why
Issue: encryption4all/postguard-business#58 — "RSS autodiscover does not work on /blog" (the blog actually lives in this repo, not postguard-business).
While investigating I found the autodiscovery link was already present on
/blog/and blog post pages (added in #149) and is live on staging today, so the literal/blog/case already works. The real, still-open gap: the link existed only on blog pages. A feed reader pointed at the root domainpostguard.eu(the most common thing a user pastes) or any non-blog page found no feed. This makes discovery site-wide.Verified against the prerendered output after the change:
/(homepage)/about//blog//blog/<post>/The blog post page (
(marketing)/blog/[slug]/+page.svelte) kept its own identical<svelte:head>RSS block. With the layout now emitting the link, that block produced a second, duplicate<link>on post pages, so it has been removed.Testing
npm run check(svelte-check) — passnpm run lint(prettier + eslint + stylelint) — passnpm run build— passnpm run test(Playwright) — pass (4/4). Addedtests/rss-autodiscovery.test.ts, a regression test asserting the autodiscovery<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml">is present exactly once in<head>on/,/about/,/blog/, and a blog post page (the post URL is discovered from the/blog/index, so it doesn't hard-code a slug). This replaces the leftover SvelteKit skeleton test (tests/test.ts), which assertedh1 === "Welcome to SvelteKit"and never matched this site./about/,/blog/, and a post page.Note: Playwright is not yet run in CI
The repo's
ci.ymldoes not runnpm run test, so the new regression test only runs locally for now. I prepared a CI job to run Playwright on every PR, but the bot token lacks GitHub'sworkflowspermission and the push was rejected, so the workflow change is not included here. A maintainer should add atestjob (build + preview +npx playwright install --with-deps chromium+npm run test) to.github/workflows/ci.ymlso this test actually guards against regressions.Note on the issue
postguard-business#58is filed on the wrong repo (postguard-business has no blog). GitHub closing keywords don't work cross-repo, so this PR can't auto-close it — the issue should be closed manually (or transferred to postguard-website) once this merges and staging redeploys.