Skip to content

feat: add RSS 2.0 feed for the blog#39

Open
wackerow wants to merge 2 commits into
ethsystems:mainfrom
wackerow:feat/blog-rss-feed
Open

feat: add RSS 2.0 feed for the blog#39
wackerow wants to merge 2 commits into
ethsystems:mainfrom
wackerow:feat/blog-rss-feed

Conversation

@wackerow

Copy link
Copy Markdown

Description

Adds a valid RSS 2.0 feed for the blog at https://iptf.ethereum.org/blog/rss.xml, with hero images attached as media and an autodiscovery link so feed readers find it automatically.

How

  • New endpoint src/pages/blog/rss.xml.ts using @astrojs/rss. Reuses the exact data path as blog/index.astro: getCollection('posts') -> isPublished() filter -> newest-first, with jekyllSlugify(title) slugs and trailing-slash links, so the feed stays in lockstep with the live blog.
  • Hero images as <enclosure> on each item: absolute URL, byte length read from the file under public/, and MIME type by extension (png/jpg/webp/gif/svg). Posts with no image, a missing file, or an unknown type are emitted without an enclosure so the feed never fails the build.
  • Autodiscovery <link rel="alternate" type="application/rss+xml"> added to the shared BaseLayout head.
  • @astrojs/rss@^4.0.18 added; relative links/enclosures resolve to absolute URLs against the existing site in astro.config.mjs (no config change required).

Verification

  • npm run build succeeds; dist/blog/rss.xml emitted.
  • 14 feed items, each matching a generated blog page 1:1.
  • All 14 items carry an <enclosure> (12 png, 1 jpeg, 1 webp); every enclosure target file confirmed present in dist/.
  • Links absolute with trailing slashes; pubDate valid RFC-822; sorted newest-first.
  • xmllint --noout confirms well-formed XML.

Notes

RSS <enclosure> is the spec-native way to attach one media item per post. If inline thumbnails in readers are preferred, Media RSS (<media:content> / <media:thumbnail>) is more broadly honored and can be added as a follow-up.

🤖 Generated by Claude Opus 4.8

wackerow and others added 2 commits June 17, 2026 11:13
Serve a feed at /blog/rss.xml via @astrojs/rss, sourced from the
`posts` collection (published-only, newest-first, trailing-slash
links) so it stays in lockstep with /blog/. Add an autodiscovery
<link rel="alternate"> in the shared head for feed readers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add each post's hero image as an <enclosure> on its RSS item:
absolute URL, byte length read from the file under public/, and
MIME type by extension (png/jpg/webp/gif/svg). Posts with no
image, a missing file, or an unknown type are emitted without an
enclosure so the feed never fails the build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@pettinarip pettinarip left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wackerow LGTM, we need to remove the pnpm lock file and merge it

Comment thread pnpm-lock.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

site not using pnpm

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.

2 participants