Difference between revisions of "rel-alternate"

From Microformats Wiki
Jump to navigation Jump to search
m (Reverted edits by Kevin Marks (Talk) to last version by Tantek)
(→‎with hreflang: see also Webmaster Tools Help)
Line 16: Line 16:
 
<link href="creator-fr" rel="alternate" hreflang="fr" title="Cr&eacute;ateur XFN 1.1" />
 
<link href="creator-fr" rel="alternate" hreflang="fr" title="Cr&eacute;ateur XFN 1.1" />
 
</source>
 
</source>
 +
 +
See also: [http://support.google.com/webmasters/bin/answer.py?hl=en&answer=189077 Google Webmaster Tools Help: rel="alternate" hreflang="x"]
  
 
=== with media ===
 
=== with media ===

Revision as of 08:34, 15 December 2011

This article is a stub. You can help the microformats.org wiki by expanding it.

special combinations

While rel="alternate" does by itself mean that the destination is some alternate representation or version of the current page, it combines in special ways with other rel values and other attributes to provide different more specific meanings, in particular:

with rel stylesheet

alternate style sheets

rel="alternate stylesheet" is how you provide an alternate style sheet for the document, and note that the style sheet is NOT an alternate representation of the current page.

with hreflang

alternate language versions

when present with an explicit hreflang attribute (with a value other than that of the document itself), rel="alternate" means a link to a version of the current document but in the language indicated by the hreflang attribute.

Example from http://gmpg.org/xfn/creator :

<link href="creator-fr" rel="alternate" hreflang="fr" title="Cr&eacute;ateur XFN 1.1" />

See also: Google Webmaster Tools Help: rel="alternate" hreflang="x"

with media

alternate devices and media

when present with an explicit media attribute, rel="alternate" means a link to a version of the current document especially for the specified device or medium indicated by the media attribute.

Example, linking to a mobile version of a site:

<a href="http://m.twitter.com" rel="alternate" media="handheld">Twitter mobile site</a>

with type

feed for the page

when present with an explicit type attribute (with a value other than that of the document itself, e.g. other than "text/html"), rel="alternate" means a link to a representation of the contents of the current document in a different format as designated by the type attribute.

Examples:

<link rel="alternate" type="application/rss+xml" href=".rss"
      title="RSS feed for this page"/>
<link rel="alternate" type="application/atom+xml" href=".atom"
      title="Atom feed for this page"/>
<link rel="alternate" type="application/activitystream+json" href=".as"
      title="Activity Streams JSON feed for this page"/>

with type and rel home

feed for the site

Main article: rel-home#use_with_rel-alternate

Proposed: when present with an explicit type attribute (with a value other than that of the document itself, e.g. other than "text/html"), rel="alternate home" means a link to a representation of the contents of the site (the home page for the current page) in a different format as designated by the type attribute.

Examples:

<link rel="alternate home" type="application/rss+xml" href=".rss"
      title="RSS feed for this site"/>
<link rel="alternate home" type="application/atom+xml" href=".atom"
      title="Atom feed for this site"/>
<link rel="alternate home" type="application/activitystream+json" href=".as"
      title="Activity Streams JSON feed for this site"/>

see also