h-feed is a microformats2 draft specification with a top level feed object to contain h-entry posts and optionally a common author. It is functionally a DRYer replacement for RSS/Atom feed files and thus could supersede them.
- 1 How
- 2 Why
- 3 IndieWeb Examples
- 4 Brainstorming
- 5 Articles
- 6 WordPress
- 7 See Also
How to markup
Mark up your
- index page with class="h-feed" (e.g. on the
- its top level
- if it links to the index (itself) then class="u-url" on that hyperlink
- otherwise if you lack any top level links, this works:
<a class="u-url" href="/"></a>
- markup the h-card you already have on your index page with class="p-author"
- and add class="u-photo" on the representative photo of your index page (e.g. banner etc.), or leave it out and let consumers imply/use the u-photo of the p-author h-card you marked up in the previous step
How to test
Feeds marked up with h-feed should work in the same way as simple lists of h-entries. See How to Test Feeds.
How to consume
So indie readers who subscribe to your site can display:
- a name (and icon) for your site/feed in a list
- authorship of the feed
- authorship of each entry in the feed
- multiple feeds from a page (less common)
IndieWeb community members that support h-feed:
Shane Becker supports h-feed on his veganstraightedge.com home page using for his composite feed of posts and on each post-type specific feed (/notes, /articles, /bookmarks, /videos, /notes) since 2012-11-18 (private repo). He previously supported just hfeed on his feeds since 2010-06-04 (private repo).
Pelle Wessman supports h-feed for his blog posts, archive, bookmarks and interactions at http://voxpelli.com/ since 2014-09-07. For blog posts only partial content with titles only – for bookmarks and interactions full content.
- Since this feed is not on the homepage, the navigation link to the notes uses
rel="feed"for feed discovery.
Ben Roberts supports h-feed on his site's main page as well as all other post lists including type specific pages (/note, /photo , etc) and monthly archives. Feeds still need next/previous links, these will likely only be on a separate (primary) h-feed off the main page. The main page has had h-feed since March 2014 but was implemented to add h-feed to any post list type page in May 2015.
Amy Guy has h-feed on homepage and all pages which are a collection of her own posts (eg. rhiaro.co.uk/tag/indieweb, rhiaro.co.uk/travel, rhiaro.co.uk/2015, rhiaro.co.uk/likes) since 2015-02-??.
- Plans to add rel=feed or something from homepage/side menu to discover different feeds.
multiple h-feeds in the same page
- The first h-feed you find on the page (document order) is the h-feed of the page
- Any additional h-feeds may be ignored by anyone processing the h-feed of the page
- If the publisher wants secondary h-feeds to be referenceable , they must put unique ID attributes on them
- Thus if consuming code wants to reference a secondary h-feed on a page it must do so with a url with the fragment ID of that secondary h-feed
Partial (e.g. truncated) vs full h-feeds.
A lot of blogs have feeds with partial content, where the entries only have post names/titles, permalinks, and sometimes summaries but not full post content. This could be done for UX reasons where the reader is not subjected to a full long post but a quick list of shorter summaries.
If you do have a partial feed (e.g. on your home page), it is good (for indie reader consumption) to also have a separate full feed page.
The partial feed can use a
u-uid u-url to link to the full feed page which could be discovered by a canonical h-feed discovery algorithm.
<div class="h-feed" id="partial_feed"> <h1 class="p-name"> <a class="u-url" href="#partial_feed">Partial Feed</a></h1> <a class="u-uid u-url" href="/feed.html">Full Feed</a> <ol> <li class="h-entry"><a href="permalink1">Article1 name</a></li> <li class="h-entry"><a href="permalink2">Article2 name</a></li> </ol> </div>
The possibility of separate partial vs full feeds provides more design freedom for content publishers, since they can choose to have a full or partial (or no!) feed on their homepage and thus design accordingly.
acegiak: KartikPrabhu: my wife's site (which I'm helping her add microformats etc to) is a potential test for this because she's an artist and wants her landing page to be quite specific in appearance.
canonical feed autodiscovery
Feed readers discover the links to legacy RSS/Atom feed files automatically from HTML pages by parsing for links with
When such links use the
<link> tag in the
<head> of the page, this provides the potential for a nice UX where the user does not need to know about the 'plumbing' of feeds / feed files.
How can (possibly multiple) h-feed feeds be discovered similarly?
Link to h-feed marked-up html pages from the home page using
type="text/html" and an optional
title=""Feed Title". Also, suggested to have
rel="feed alternate". See also rel-feed.
Alternatively, if an h-feed has a u-url u-uid property that is not the URL of the current page itself, then that u-url u-uid URL can be treated as the canonical full feed.
- "IndieWeb: fragment subscriptions to microformats" on Superfeedr.
WordPress classic hfeed
A large percentage of WordPress themes (how many? since when? #/% users?) use the classic hAtom
hfeed class on every page, as opposed to only on pages with multiple
hentry entries. Due to the popularity of WordPress, this is present on a large number of websites.
WordPress theme support
- Aaron Parecki As of 2018-08, the state of WordPress theme support of Microformats is spotty:
- aaronpk: I even subscribe to wordpress Atom feeds over microformats feeds when I follow people in my reader because the mf2 is always so inconsistent source
- However, when done properly, the Microformats feeds provide much richer data than other feed formats since they can convey a variety of post types, responses with rich reply-context (e.g. with h-cite), etc.
- need URL example(s) of richer h-feed in a WordPress Theme, more post types, reply-contexts, etc.