Feed Autodiscovery
December 3rd, 2006 by Lachlan Hunt
We’ve recently added link
types to HTML 5. In particular we defined
the mechanism for syndication feed autodiscovery. Autodiscovery has
become widely deployed and implemented already since its inception in
2002, using the link element with the alternate relationship and a type attribute
indicating the format of the feed.
<link rel="alternate" type="application/atom+xml"
href="/feed.atom" title="Atom Feed">
<link rel="alternate" type="application/rss+xml"
href="/feed.rss" title="RSS Feed">
For backwards compatibility, we must retain support for, and explicitly define,
that method. However, there are two main issues with using the alternate
relationship:
- Syndication feeds are not necessarily alternate representations of the page.
- The MIME type is not always a good indication that a resource is a feed.
For example, hAtom uses regular HTML with the MIME type
text/html, yet may still be used as a syndication feed format.
To address this issue, we have introduced a new feed relationship which indicates
that the referenced document is a syndication feed. This now allows you to
link to several different feeds containing different content which are not necessarily
alternate versions of the page.
<link rel="feed" type="application/atom+xml"
href="/feed/comments" title="All comments">
<link rel="feed" type="application/atom+xml"
href="/feed/summaries" title="Article Summaries">
It also means that you do not need to specify the type attribute to have the
link recognised as a syndication feed and browsers can still show it in the
subscription list.
<link rel="feed" href="/feed" title="Articles">
Another benefit of this is that if there is ever a new syndication feed format, you don’t have to wait for browsers to be updated with the new MIME type to recognise it as a feed. For instance, if your feed reader supports the hAtom microformat, you could subscribe to an HTML document that has been linked to as a feed.
<link rel="feed" type="text/html"
href="/feed.html" title="All comments">
In order to retain backwards compatibility, the definition
for alternate says
that when used in combination with a type attribute with the value of either
application/rss+xml or application/atom+xml.then it implies the feed keyword
as well.
The feed keyword can also be used in combination with alternate to say that
it is specifically the feed for the current document.
<link rel="feed alternate" type="application/atom+xml"
href="/feed.atom" title="Atom Feed">
However, it’s important not to confuse this with the way alternate stylesheets
works. The behaviour of rel="alternate stylesheet" is a special
case where the use of alternate doesn’t mean an alternate representation
of the document itself. In fact, if when used together with stylesheet, that
is the one case where the type value cannot imply the feed value.
<link rel="alternate stylesheet" type="application/atom+xml"
href="/feed.atom" title="This is not a feed!">
Mozilla already has bugs filed for implementing
the new feed relationship and fixing its bug
with with rel="alternate stylesheet" which are planned for inclusion
in Firefox 3.0.
December 3rd, 2006 at 18:09
If a page supported hAtom, could this be valid: <link rel=”feed” href=”"> ? I.e., a page is its own feed.
December 4th, 2006 at 07:28
Ian, that would be unnecessary, since the browser can already detect the hAtom markup in the page and offer to subscribe to it. It would just need to be implemented.
December 4th, 2006 at 09:27
[...] The WHATWG Blog has announced the addition of a new link type in HTML5 for linking to feeds (rel=”feed”). The post notes that this can make auto-discovery easier and also makes linking to hAtom feeds tidier. [...]
December 5th, 2006 at 05:22
[...] The WHATWG Blog » Blog Archive » Feed Autodiscovery “Another benefit of this is that if there is ever a new syndication feed format, you don’t have to wait for browsers to be updated with the new MIME type to recognise it as a feed.” Independent evolution, check! (tags: atom autodiscovery rest web) [...]
January 24th, 2007 at 01:33
[...] None of their pages have the feed autodiscovery element, so none of the web will ever find their feed [...]
February 7th, 2007 at 20:34
And again feed discovery only talks about LINK elements, not A elements. Everybody already has an orange XML button, with an A link pointing to the feed. Why not just add the rel and type attributes to that element.
February 8th, 2007 at 22:22
Aukcje: how to make a difference between you linking to a feed you are subscribed to, and the feed for the page you are on? rel=”alternate” in the context of a body-element and rel=”alternate” in head-context seem to have different purpose to me. Aukcje
February 23rd, 2007 at 06:19
The WHATWG Blog has announced the addition of a new link type in HTML5 for linking to feeds (rel=”feed”). The post notes that this can make auto-discovery easier and also makes linking to hAtom feeds tidier.
March 7th, 2007 at 23:13
I’d suggest specyfing self-referencing <link> anyway, since browser may not support hAtom, but user may have external application that does.
March 20th, 2007 at 12:57
Fuck! Feed is rel=”index” (& media for rss, atom or html index), for what new value?
April 3rd, 2007 at 06:15
it doesnt seem to be work, i ve activate all plug ins in my software
April 15th, 2007 at 08:44
WHATWG Blog has announced the addition of a new link type in HTML5 for linking to feeds (rel=”feed”). The post notes that this can make auto-discovery easier and also makes linking to hAtom feeds tidier
April 21st, 2007 at 17:07
Ian, that would be unnecessary, since the browser can already detect the hAtom markup in the page and offer to subscribe to it..
May 1st, 2007 at 18:21
[...] The WHATWG Blog has announced the addition of a new link type in HTML5 for linking to feeds (rel=”feed”). The post notes that this can make auto-discovery easier and also makes linking to hAtom feeds tidier. [...]
June 18th, 2007 at 18:35
And again feed discovery only talks about LINK elements not A elements. Everybody already has an orange XML button with an A link pointing to the feed. Why not just add the rel and type attributes to that element…
June 20th, 2007 at 23:56
Nice information.
And how long ago was ‘nofollow’ tag implemented? As I remeber it was the first of such kind ‘tags’. But I may be wrong
And where may I find information on all these link types?
July 15th, 2007 at 20:41
Ian, that would be unnecessary, since the browser can already detect the hAtom markup in the page and offer to subscribe to it. It would just need to be implemented. Her yere dadanmayın
July 20th, 2007 at 08:49
The post notes that this can make auto-discovery easier and also makes linking to hAtom feeds tidier.
Why not just add the rel and type attributes to that element.