h-feed: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
(→‎Properties: editorial: more explicit clarification of existing functionality that all properties are optional and plural meaning they may have multiple instances, not that each property instance takes multiple values (no one has ever implemented that, fortunately))
 
(40 intermediate revisions by 8 users not shown)
Line 1: Line 1:
HOW THING OUT
<dfn style="font-style:normal;font-weight:bold">h-feed</dfn> is a simple, open format for publishing a stream or feed of [[h-entry]] posts, like complete posts on a home page or archive pages, or summaries or other brief lists of posts. h-feed is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML.
HOW ANYTHING OUT
 
HOW EVERYTHING OUT
h-feed is the [[microformats2]] update to [[hAtom]], and in particular its "hfeed" root class.
HOW UNIVERSE OUT
 
HOW MAKE THING OUT
;<span id="status">Status</span>
HOW MAKE ANYTHING OUT
:'''h-feed''' is a microformats.org draft specification.
HOW MAKE EVERYTHING OUT
:h-feed is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-feed up as a classic [[hAtom]] "hfeed".
HOW MAKE UNIVERSE OUT
 
HOW THING BE OUT
;<span id="participate">Participate</span>
HOW ANYTHING BE OUT
:[https://github.com/microformats/h-feed/issues Open Issues]
HOW EVERYTHING BE OUT
:[[IRC]]
HOW UNIVERSE BE OUT
;Editor
HOW MAKE THING BE OUT
:<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
HOW MAKE ANYTHING BE OUT
;License
HOW MAKE EVERYTHING BE OUT
: {{cc0-owfa-license}}
HOW MAKE UNIVERSE BE OUT
__TOC__
HOW THING OUT
 
HOW ANYTHING OUT
== Properties ==
HOW EVERYTHING OUT
h-feed properties, inside an element with class '''h-feed'''. All properties are both optional and may have multiple instances, e.g. multiple name, url, photo etc. properties.
HOW UNIVERSE OUT
 
HOW MAKE THING OUT
root class name: h-feed
HOW MAKE ANYTHING OUT
 
HOW MAKE EVERYTHING OUT
=== Core Properties ===
HOW MAKE UNIVERSE OUT
The following ''core'' h-feed properties have broad consensus:
HOW THING BE OUT
* '''<code>p-name</code>''' - name of the feed
HOW ANYTHING BE OUT
* '''<code>p-author</code>''' - author of the feed, optionally embed an [[h-card]] {{main|h-card}}
HOW EVERYTHING BE OUT
* '''<code>u-url</code>''' - URL of the feed
HOW UNIVERSE BE OUT
* '''<code>u-photo</code>''' - representative photo / icon for the feed
HOW MAKE THING BE OUT
 
HOW MAKE ANYTHING BE OUT
children:
HOW MAKE EVERYTHING BE OUT
* nested [[h-entry]] objects representing the items of the feed
HOW MAKE UNIVERSE BE OUT
 
HOW THING OUT
=== Draft Properties ===
HOW ANYTHING OUT
None currently.
HOW EVERYTHING OUT
 
HOW UNIVERSE OUT
=== Proposed Properties ===
HOW MAKE THING OUT
The following properties are proposed additions based on various observed examples in the wild, but are awaiting at least one reader / real world consuming code example to become a draft property:
HOW MAKE ANYTHING OUT
* '''<code>p-summary</code>''' - based on non-trivial actual content usage of "atom:subtitle" on Blogger and WordPress.com featured blogs's Atom feeds.
HOW MAKE EVERYTHING OUT
* '''<code>p-entry</code>''' - to be more consistent with the cascading of p-author or [http://microformats.org/wiki/comment-brainstorming#Proposal p-comment].
HOW MAKE UNIVERSE OUT
 
HOW THING BE OUT
== Proposed Additions ==
HOW ANYTHING BE OUT
 
HOW EVERYTHING BE OUT
* Proposal that h-feed not be limited to h-entry, due use cases for feeds of h-cards or h-events https://github.com/microformats/h-feed/issues/3
HOW UNIVERSE BE OUT
* Proposal to add implied h-feed in cases where no h-feed is explicitly marked up. https://github.com/microformats/h-feed/issues/1
HOW MAKE THING BE OUT
 
HOW MAKE ANYTHING BE OUT
== Discovery ==
HOW MAKE EVERYTHING BE OUT
Implementations may discover one or more h-feeds in several ways.
HOW MAKE UNIVERSE BE OUT
 
HOW THING OUT
* If the implementation is given a URL (e.g. from a user entering it) to do h-feed discovery, it:
HOW ANYTHING OUT
** SHOULD do traditional feed discovery by looking through link elements with a rel value of "alternate"
HOW EVERYTHING OUT
** For each link alternate with a media type of <code>[https://indieweb.org/text/mf2%2Bhtml text/mf2+html]</code>
HOW UNIVERSE OUT
**# get its href,
HOW MAKE THING OUT
**# do any relative-URL resolution needed on that href to construct an absolute URL
HOW MAKE ANYTHING OUT
**# fetch that absolute URL and [[microformats2-parsing|parse it]] (within a specific element matching a fragment in the URL if any) for microformats2 items,
HOW MAKE EVERYTHING OUT
**# look for top-level items (within that fragment element subtree if any) of type "h-feed"
HOW MAKE UNIVERSE OUT
** ALSO implementations MAY [[microformats2-parsing|parse the whole document]] and look in its top level items for those of type "h-feed"
HOW THING BE OUT
 
HOW ANYTHING BE OUT
* If the implementation has already parsed an HTML document, it may look for elements with a class name of "h-feed"
HOW EVERYTHING BE OUT
 
HOW UNIVERSE BE OUT
Details:
HOW MAKE THING BE OUT
* Implementations may fetch public h-feeds without having to pass cookies or any other user-identifying information
HOW MAKE ANYTHING BE OUT
* Implementations should parse h-feed documents without executing any scripts (parse as if scripting is disabled or unimplemented)
HOW MAKE EVERYTHING BE OUT
* If an implementation needs only one h-feed, it should take the first one found per the above methods
HOW MAKE UNIVERSE BE OUT
 
HOW THING OUT
=== Implied h-feed ===
HOW ANYTHING OUT
In the absence of an explicit "h-feed" element, implementations may infer an h-feed of all top level microformats items in the document (as determined by [[microformats2-parsing]] the document). Among those top level items, if precisely one of them is an "h-card" then it is used to imply a "p-author h-card" property of the implied "h-feed" and is removed from the "children" array of the implied "h-feed".
HOW EVERYTHING OUT
 
HOW UNIVERSE OUT
E.g. if an archive page has a collection of h-entry elements at the top level, implementations may imply an h-feed container for all of them and treat the entire document as a feed.
HOW MAKE THING OUT
 
HOW MAKE ANYTHING OUT
== Examples in the wild ==
HOW MAKE EVERYTHING OUT
 
HOW MAKE UNIVERSE OUT
See https://indieweb.org/h-feed#IndieWeb_Examples for examples of h-feed in the wild.
HOW THING BE OUT
 
HOW ANYTHING BE OUT
== Consumers ==
HOW EVERYTHING BE OUT
 
HOW UNIVERSE BE OUT
See https://indieweb.org/h-feed#Consumers_of_H-Feed for examples of implementations that consume h-feed.
HOW MAKE THING BE OUT
 
HOW MAKE ANYTHING BE OUT
== Backward Compatibility ==
HOW MAKE EVERYTHING BE OUT
=== Publisher Compatibility ===
HOW MAKE UNIVERSE BE OUT
For backward compatibility, you may wish to use classic [[hAtom]] classnames in addition to the more future-proof h-feed properties, for example:
HOW THING OUT
 
HOW ANYTHING OUT
<syntaxhighlight lang="html">
HOW EVERYTHING OUT
<div class="h-feed hfeed">
HOW UNIVERSE OUT
  <h1 class="p-name site-title">The Markup Blog</h1>
HOW MAKE THING OUT
  <p class="p-summary site-description">Stories of elements of their attributes.</p>
HOW MAKE ANYTHING OUT
 
HOW MAKE EVERYTHING OUT
  <article class="h-entry hentry">
HOW MAKE UNIVERSE OUT
    <a class="u-url" rel="bookmark" href="2020/06/22/balanced-divisive-complementary">
HOW THING BE OUT
      <h2 class="p-name entry-title">A Tale Of Two Tags: Part 2</h2>
HOW ANYTHING BE OUT
    </a>
HOW EVERYTHING BE OUT
    <address class="p-author author h-card vcard">
HOW UNIVERSE BE OUT
      <a href="https://chandra.example.com/" class="u-url url p-name fn" rel="author">Chandra</a>
HOW MAKE THING BE OUT
    </address>
HOW MAKE ANYTHING BE OUT
    <time class="dt-published published" datetime="2012-06-22T09:45:57-07:00">June 21, 2012</time>
HOW MAKE EVERYTHING BE OUT
    <div class="p-summary entry-summary">
HOW MAKE UNIVERSE BE OUT
      <p>From balanced harmony, to divisive misunderstandings, to complementary roles.</p>
HOW THING OUT
    </div>
HOW ANYTHING OUT
    <a href="/category/uncategorized/" rel="category tag" class="p-category">General</a>
HOW EVERYTHING OUT
  </article>
HOW UNIVERSE OUT
 
HOW MAKE THING OUT
  <article class="h-entry hentry">
HOW MAKE ANYTHING OUT
    <a class="u-url" rel="bookmark" href="2020/06/20/best-visible-alternative-invisible">
HOW MAKE EVERYTHING OUT
      <h2 class="p-name entry-title">A Tale Of Two Tags: Part 1</h2>
HOW MAKE UNIVERSE OUT
    </a>
HOW THING BE OUT
    <address class="p-author author h-card vcard">
HOW ANYTHING BE OUT
      <a href="https://chandra.example.com/" class="u-url url p-name fn" rel="author">Chandra</a>
HOW EVERYTHING BE OUT
    </address>
HOW UNIVERSE BE OUT
    <time class="dt-published published" datetime="2012-06-20T08:34:46-07:00">June 20, 2012</time>
HOW MAKE THING BE OUT
    <div class="p-summary entry-summary">
HOW MAKE ANYTHING BE OUT
      <p>It was the best of visible tags, it was the alternative invisible tags.</p>
HOW MAKE EVERYTHING BE OUT
    </div>
HOW MAKE UNIVERSE BE OUT
    <a href="/category/uncategorized/" rel="category tag" class="p-category">General</a>
HOW THING OUT
  </article>
HOW ANYTHING OUT
 
HOW EVERYTHING OUT
</div>
HOW UNIVERSE OUT
</syntaxhighlight>
HOW MAKE THING OUT
 
HOW MAKE ANYTHING OUT
{{note|Note: you may use any valid HTML5 elements. The <code>article h1 h2 address time</code> elements are used in the example as semantically richer suggestions, however in general <code>div span</code> work fine too. The <code>time</code> element is special though in that its <code>datetime</code> attribute provides a more author/user friendly way of separating a machine readable ISO8601 datetime from a human readable summary.
HOW MAKE EVERYTHING OUT
}}
HOW MAKE UNIVERSE OUT
 
HOW THING BE OUT
The class '''<code>hfeed</code>''' is a ''backward compatible root class name'' that indicates the presence of an [[hAtom]] feed.
HOW ANYTHING BE OUT
 
HOW EVERYTHING BE OUT
Backward compatibility hAtom property class names and rel values are listed below.
HOW UNIVERSE BE OUT
 
HOW MAKE THING BE OUT
=== Parser Compatibility ===
HOW MAKE ANYTHING BE OUT
Microformats parsers {{should}} detect classic properties only if a classic root class name is found and parse them as microformats2 properties.
HOW MAKE EVERYTHING BE OUT
 
HOW MAKE UNIVERSE BE OUT
If an "h-feed" is found, don't look for an "hfeed" on the same element.
HOW THING OUT
 
HOW ANYTHING OUT
Compat root class name: <code id="hfeed">hfeed</code><br/>
HOW EVERYTHING OUT
Properties: (parsed as '''p-''' plain text unless otherwise specified):
HOW UNIVERSE OUT
 
HOW MAKE THING OUT
(this section is a stub and needs review and citations to note what real world examples would each of these backcompat parsing rules actually help parse)
HOW MAKE ANYTHING OUT
 
HOW MAKE EVERYTHING OUT
* <code>rel=tag</code> - parse as '''<code>p-category</code>'''. While not a class name nor typical microformats property, rel=tag was the defined way to tag an hfeed. Thus parsers should look for rel=tag hyperlinks inside an hfeed, and take the last path segment of their "href" value as a value for a '''<code>p-category</code>''' property.
HOW MAKE UNIVERSE OUT
* <code>site-title</code> - parse as '''<code>p-name</code>''' [WordPress (Core? Typical themes?) has this class name by default, and without it buggy parsers may imply p-name as the whole h-feed ([http://microformats.org/wiki/microformats2-parsing#parsing_for_implied_properties implied properties only apply to actual h-x roots, not backcompat]).]
HOW THING BE OUT
* <code>site-description</code> - parse as '''<code>p-summary</code>''' [WordPress (Core? Typical themes?) has this class name by default]
HOW ANYTHING BE OUT
 
HOW EVERYTHING BE OUT
If no "h-feed" nor "hfeed" element is found, however multiple top-level [[h-entry]] elements (explicit or backcompat) are found, implementations may use:
HOW UNIVERSE BE OUT
* top level [[h-entry]] elements as items in a synthetic h-feed.
HOW MAKE THING BE OUT
* <code>&lt;title&gt;</code> of the page or the URL of the page as '''<code>p-name</code>'''
HOW MAKE ANYTHING BE OUT
* https://indieweb.org/authorship on the page to discover default authorship for any h-entry posts lacking explicit parsed <code>author</code> properties.
HOW MAKE EVERYTHING BE OUT
 
HOW MAKE UNIVERSE BE OUT
== FAQ ==
HOW THING OUT
=== How do I avoid duplicating the page title ===
HOW ANYTHING OUT
''I want to use the name (title) of my page as the name of my feed, how do I avoid duplicating the page title somewhere invisibly on the page as the feed name?''
HOW EVERYTHING OUT
 
HOW UNIVERSE OUT
If you want re-use the &lt;title&gt; of your page as the name of your feed, you can do so by putting the h-feed root class name on the &lt;html&gt; element, and the p-name property class name on the &lt;title&gt; element, e.g. here's a snippet showing how those tags would look:
HOW MAKE THING OUT
 
HOW MAKE ANYTHING OUT
<syntaxhighlight lang="html">
HOW MAKE EVERYTHING OUT
<html class="h-feed">
HOW MAKE UNIVERSE OUT
  …
HOW THING BE OUT
  <title class="p-name">The Markup Blog</title>
HOW ANYTHING BE OUT
  …
HOW EVERYTHING BE OUT
</syntaxhighlight>
HOW UNIVERSE BE OUT
 
HOW MAKE THING BE OUT
== See Also ==
HOW MAKE ANYTHING BE OUT
* [[h-entry]]
HOW MAKE EVERYTHING BE OUT
* [[microformats2]]
HOW MAKE UNIVERSE BE OUT
* [[hAtom]]
HOW THING OUT
 
HOW ANYTHING OUT
[[Category:Draft Specifications]]
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT
HOW THING OUT
HOW ANYTHING OUT
HOW EVERYTHING OUT
HOW UNIVERSE OUT
HOW MAKE THING OUT
HOW MAKE ANYTHING OUT
HOW MAKE EVERYTHING OUT
HOW MAKE UNIVERSE OUT
HOW THING BE OUT
HOW ANYTHING BE OUT
HOW EVERYTHING BE OUT
HOW UNIVERSE BE OUT
HOW MAKE THING BE OUT
HOW MAKE ANYTHING BE OUT
HOW MAKE EVERYTHING BE OUT
HOW MAKE UNIVERSE BE OUT

Latest revision as of 17:50, 23 May 2024

h-feed is a simple, open format for publishing a stream or feed of h-entry posts, like complete posts on a home page or archive pages, or summaries or other brief lists of posts. h-feed is one of several open microformat draft standards suitable for embedding data in HTML.

h-feed is the microformats2 update to hAtom, and in particular its "hfeed" root class.

Status
h-feed is a microformats.org draft specification.
h-feed is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-feed up as a classic hAtom "hfeed".
Participate
Open Issues
IRC
Editor
Tantek Çelik (Editor)
License
Per CC0, to the extent possible under law, the editors have waived all copyright and related or neighboring rights to this work. In addition, as of 2024-11-24, the editors have made this specification available under the Open Web Foundation Agreement Version 1.0.

Properties

h-feed properties, inside an element with class h-feed. All properties are both optional and may have multiple instances, e.g. multiple name, url, photo etc. properties.

root class name: h-feed

Core Properties

The following core h-feed properties have broad consensus:

  • p-name - name of the feed
  • p-author - author of the feed, optionally embed an h-card
    Main article: h-card
  • u-url - URL of the feed
  • u-photo - representative photo / icon for the feed

children:

  • nested h-entry objects representing the items of the feed

Draft Properties

None currently.

Proposed Properties

The following properties are proposed additions based on various observed examples in the wild, but are awaiting at least one reader / real world consuming code example to become a draft property:

  • p-summary - based on non-trivial actual content usage of "atom:subtitle" on Blogger and WordPress.com featured blogs's Atom feeds.
  • p-entry - to be more consistent with the cascading of p-author or p-comment.

Proposed Additions

Discovery

Implementations may discover one or more h-feeds in several ways.

  • If the implementation is given a URL (e.g. from a user entering it) to do h-feed discovery, it:
    • SHOULD do traditional feed discovery by looking through link elements with a rel value of "alternate"
    • For each link alternate with a media type of text/mf2+html
      1. get its href,
      2. do any relative-URL resolution needed on that href to construct an absolute URL
      3. fetch that absolute URL and parse it (within a specific element matching a fragment in the URL if any) for microformats2 items,
      4. look for top-level items (within that fragment element subtree if any) of type "h-feed"
    • ALSO implementations MAY parse the whole document and look in its top level items for those of type "h-feed"
  • If the implementation has already parsed an HTML document, it may look for elements with a class name of "h-feed"

Details:

  • Implementations may fetch public h-feeds without having to pass cookies or any other user-identifying information
  • Implementations should parse h-feed documents without executing any scripts (parse as if scripting is disabled or unimplemented)
  • If an implementation needs only one h-feed, it should take the first one found per the above methods

Implied h-feed

In the absence of an explicit "h-feed" element, implementations may infer an h-feed of all top level microformats items in the document (as determined by microformats2-parsing the document). Among those top level items, if precisely one of them is an "h-card" then it is used to imply a "p-author h-card" property of the implied "h-feed" and is removed from the "children" array of the implied "h-feed".

E.g. if an archive page has a collection of h-entry elements at the top level, implementations may imply an h-feed container for all of them and treat the entire document as a feed.

Examples in the wild

See https://indieweb.org/h-feed#IndieWeb_Examples for examples of h-feed in the wild.

Consumers

See https://indieweb.org/h-feed#Consumers_of_H-Feed for examples of implementations that consume h-feed.

Backward Compatibility

Publisher Compatibility

For backward compatibility, you may wish to use classic hAtom classnames in addition to the more future-proof h-feed properties, for example:

<div class="h-feed hfeed">
  <h1 class="p-name site-title">The Markup Blog</h1>
  <p class="p-summary site-description">Stories of elements of their attributes.</p>

  <article class="h-entry hentry">
    <a class="u-url" rel="bookmark" href="2020/06/22/balanced-divisive-complementary">
      <h2 class="p-name entry-title">A Tale Of Two Tags: Part 2</h2>
    </a>
    <address class="p-author author h-card vcard">
      <a href="https://chandra.example.com/" class="u-url url p-name fn" rel="author">Chandra</a>
    </address>
    <time class="dt-published published" datetime="2012-06-22T09:45:57-07:00">June 21, 2012</time>
    <div class="p-summary entry-summary">
      <p>From balanced harmony, to divisive misunderstandings, to complementary roles.</p>
    </div>
    <a href="/category/uncategorized/" rel="category tag" class="p-category">General</a>
  </article>

  <article class="h-entry hentry">
    <a class="u-url" rel="bookmark" href="2020/06/20/best-visible-alternative-invisible">
      <h2 class="p-name entry-title">A Tale Of Two Tags: Part 1</h2>
    </a>
    <address class="p-author author h-card vcard">
      <a href="https://chandra.example.com/" class="u-url url p-name fn" rel="author">Chandra</a>
    </address>
    <time class="dt-published published" datetime="2012-06-20T08:34:46-07:00">June 20, 2012</time>
    <div class="p-summary entry-summary">
      <p>It was the best of visible tags, it was the alternative invisible tags.</p>
    </div>
    <a href="/category/uncategorized/" rel="category tag" class="p-category">General</a>
  </article>

</div>
ℹ️ Note: Note: you may use any valid HTML5 elements. The article h1 h2 address time elements are used in the example as semantically richer suggestions, however in general div span work fine too. The time element is special though in that its datetime attribute provides a more author/user friendly way of separating a machine readable ISO8601 datetime from a human readable summary.

The class hfeed is a backward compatible root class name that indicates the presence of an hAtom feed.

Backward compatibility hAtom property class names and rel values are listed below.

Parser Compatibility

Microformats parsers SHOULD detect classic properties only if a classic root class name is found and parse them as microformats2 properties.

If an "h-feed" is found, don't look for an "hfeed" on the same element.

Compat root class name: hfeed
Properties: (parsed as p- plain text unless otherwise specified):

(this section is a stub and needs review and citations to note what real world examples would each of these backcompat parsing rules actually help parse)

  • rel=tag - parse as p-category. While not a class name nor typical microformats property, rel=tag was the defined way to tag an hfeed. Thus parsers should look for rel=tag hyperlinks inside an hfeed, and take the last path segment of their "href" value as a value for a p-category property.
  • site-title - parse as p-name [WordPress (Core? Typical themes?) has this class name by default, and without it buggy parsers may imply p-name as the whole h-feed (implied properties only apply to actual h-x roots, not backcompat).]
  • site-description - parse as p-summary [WordPress (Core? Typical themes?) has this class name by default]

If no "h-feed" nor "hfeed" element is found, however multiple top-level h-entry elements (explicit or backcompat) are found, implementations may use:

  • top level h-entry elements as items in a synthetic h-feed.
  • <title> of the page or the URL of the page as p-name
  • https://indieweb.org/authorship on the page to discover default authorship for any h-entry posts lacking explicit parsed author properties.

FAQ

How do I avoid duplicating the page title

I want to use the name (title) of my page as the name of my feed, how do I avoid duplicating the page title somewhere invisibly on the page as the feed name?

If you want re-use the <title> of your page as the name of your feed, you can do so by putting the h-feed root class name on the <html> element, and the p-name property class name on the <title> element, e.g. here's a snippet showing how those tags would look:

<html class="h-feed"><title class="p-name">The Markup Blog</title>

See Also