Skip to content

blog: Atom feed at /blog/feed.xml + index discovery link#48

Open
daliu wants to merge 1 commit into
masterfrom
blog-enh/rss-feed
Open

blog: Atom feed at /blog/feed.xml + index discovery link#48
daliu wants to merge 1 commit into
masterfrom
blog-enh/rss-feed

Conversation

@daliu

@daliu daliu commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What

Top unchecked item from the blog-enhancement backlog: RSS/Atom feed at /blog/feed.xml (+ <link rel="alternate"> in the index head).

  • scripts/build_blog.py now emits blog/feed.xml (Atom 1.0) on every build: newest-first entries with title, alternate link, id, RFC-3339 updated, summary from the description, <category> per tag, and the rendered post body escaped inside <content type="html">.
  • The blog index <head> gets <link rel="alternate" type="application/atom+xml" ...> for feed autodiscovery. splice_index injects it idempotently into existing chrome (after the canonical link), so the hand-preserved index didn't need a full regeneration. Post pages are unchanged — the backlog item scopes discovery to the index.
  • Deterministic by design: feed-level <updated> is the newest post's date (fixed epoch when empty) — no wall-clock, so unchanged sources rebuild byte-identical and --check stays quiet.

Included rebuilt output

  • blog/feed.xml (new), one-line head addition in blog/index.html.
  • sitemap.xml: the blog URLs (/blog/, /blog/welcome.html) had dropped out of master's sitemap; running the build restored them via the existing additive merge_sitemap (no non-blog entries touched).

Tests

+15 tests in tests/test_build_blog.py: Atom well-formedness (parsed with ElementTree), entry fields, HTML-content escaping, tag→category mapping, empty-feed validity, determinism, discovery-link presence/injection/idempotency, and build() outputs. Full suite: 159 passed.

Per the loop rules: base master, do not merge — awaiting Dave's review.

🤖 Generated with Claude Code

Top backlog item from the blog-enhancement loop. build_blog.py now emits
blog/feed.xml (Atom 1.0, newest-first, escaped HTML content, tags as
categories) alongside the post pages, and the blog index <head> carries
<link rel="alternate" type="application/atom+xml"> for feed discovery —
injected idempotently into existing chrome by splice_index, so no full
index regeneration was needed.

Deterministic on purpose: feed-level <updated> is the newest post's date
(fixed epoch when empty), so unchanged sources rebuild byte-identical and
--check stays quiet.

Includes the rebuilt output (feed.xml, index head line) and the sitemap
re-merge — the blog URLs had dropped out of master's sitemap.xml; running
the build restored them via the existing additive merge.

tests/test_build_blog.py: +15 tests (feed structure via ElementTree,
escaping, categories, determinism, discovery-link injection + idempotency,
build outputs). Full suite: 159 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant