Using link rel for discovering feeds

The HTML <link> tag can be used any number of times in the <head> element to define document relationships.

Perhaps the best-known example of the <link rel=”…” > construction is the reference to a stylesheet:

<link rel="stylesheet" href="mystyle.css" type="text/css" />

but another use, now very common, is to declare the documents that provide the syndication feeds, either RSS or Atom, for the current page:

<link rel="alternate" type="application/atom+xml" title="Atom" href="http://www.cloudsoup.com/weblog/wp-atom.php" />

<link rel=”alternate” type=”application/rss+xml” title=”RSS” href=”http://www.cloudsoup.com/weblog/wp-rss2.php” />

And the reason why you’d want to do this? It’s because smart feed readers like, say, SharpReader can be given the URL of the HTML page and will automatically discover the syndication feed to read and subscribe. You don’t have to display any orange XML buttons on your page: the reader sorts it out for you.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*