Adding multiple h-feeds to the same web page
Summary
A web page listing notes from IndieWeb events utilizes multiple `h-feed` microformats to generate distinct RSS feeds from a single HTML document. Each `h-feed` corresponds to a specific event category, such as writing meet-ups or regional gatherings, and is uniquely identified by an HTML ID. Tools like Granary can process a specific `h-feed` fragment from a URL (e.g., `/hwc-notes#hwc-pacific`) to convert only that section into an RSS feed. This approach allows for the creation of multiple specialized feeds from one source page, reducing maintenance overhead compared to generating separate RSS feeds for each category. The author demonstrates how different feeds, like "all" and "Europe," appear in an RSS reader like Artemis, confirming their distinct content.
Key takeaway
For web developers managing content feeds, you can significantly reduce maintenance by consolidating multiple feeds into a single HTML document using `h-feed` microformats and unique HTML IDs. This strategy allows you to offer specialized RSS feeds without the overhead of generating and maintaining separate feed files, streamlining your content delivery workflow and improving user experience for specific interests.
Key insights
Multiple `h-feed` elements on a single page can generate distinct RSS feeds using URL fragments.
Principles
- Use HTML IDs to segment `h-feed` content.
- A single HTML document can serve multiple feeds.
Method
Embed multiple `h-feed` elements with unique HTML IDs on a single page. Use a tool like Granary, with URL-encoded fragment identifiers, to convert specific `h-feed` sections into RSS.
In practice
- Generate category-specific feeds from one source.
- Reduce maintenance by consolidating HTML.
- Use `mf2py` to parse specific `h-feed` fragments.
Topics
- h-feed
- Microformats
- RSS Feed Generation
- Granary
- Web Content Syndication
Best for: Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by James' Coffee Blog.