If you've read my Getting Semantic With Microformats blog series or my book, Microformats Made Simple, you should be familiar with profile URIs for microformats and hopefully you are using them.
Recently, the microformats community completed updates to the profile URIs for all microformats, including most drafts. So now is the time for you to update your references!
Um, What?
If you are scratching your head, wondering what the hell I'm talking about, here's a bit of background:
All microformats have an associated XMDP, which defines the metadata and class
es that are specified in a given microformat. And each profile has a unique URI that is used for referencing it on web pages containing the microformats it defines.
For example, the profile URI for XFN is http://gmpg.org/xfn/11, while the profile URI for hCalendar is http://microformats.org/profile/hcalendar.
Referencing these profiles in pages that contain microformats is recommended, but not required. But you never know if this will change in the future, so I personally recommend including them by default.
Referencing Profiles in HTML 4
To reference a profile on a page using HTML 4, you simply add the profile
attribute to your page's <head>
element:
<head profile="http://gmpg.org/xfn/11">
And if you use more than one microformat on your page, the W3C allows multiple profile
values, separated by a single space character. For example, if you have both XFN and hCalendar on your page, you would use:
<head profile="http://gmpg.org/xfn/11 http://microformats.org/profile/hcalendar">
Combined Profile
There is also a combined profile URI for all non-draft microformats: http://microformats.org/profile/specs.
So if you are using more than one non-draft microformat on your page, you can use this combined profile, rather than listing all of the individual profiles for each microformat:
<head profile="http://microformats.org/profile/specs">
For draft microformats, you can't use the combined profile; you need to specify the profile for that particular draft. If you are referencing both non-draft and draft microformats, you can use the combined profile URI along with the profiles for drafts:
<head profile="http://microformats.org/profile/specs http://microformats.org/profile/hatom http://microformats.org/profile/hresume">
The above example indicates I'm using the combined profile, as well as the profiles for the hAtom and hResume draft microformats.
Profiles in HTML5
The HTML5 specification has dropped the profile
attribute for <head>
, so if you are using HTML5, you need to declare your microformats profile URIs differently than I've described above.
In HTML5, you actually have two options. You can declare the URI as the href
of a visible hyperlink (<a>
) or a hidden link (<link>
) that has rel="profile"
assigned:
<p>This page is microformat friendly: <a rel="profile" href="http://microformats.org/profile/hcalendar">hCalendar</a>, <a rel="profile" http://gmpg.org/xfn/11">XFN</a>.<p>
<link rel="profile" href="http://microformats.org/profile/specs" />
Personally, for my HTML5 sites, I will be using this second example in my <head>
. This will mean, though, that I may have multiple <link>
s in my document <head>
, especially if I'm using more than one microformat that is not included in the combined profile URI. Not really an issue for me, but worth mentioning.
For more detail, the Microformats Wiki explains HTML5 profiles further.
New URIs
Enough background, here's what you need:
- Combined profile (hCard, hCalendar, rel-license, rel-tag, XOXO, XFN, VoteLinks)
- http://microformats.org/profile/specs
- adr (uses the hCard profile)
- http://microformats.org/profile/hcard
- geo (uses the hCard profile)
- http://microformats.org/profile/hcard
- hAtom
- http://microformats.org/profile/hatom
- hCalendar
- http://microformats.org/profile/hcalendar
- hCard
- http://microformats.org/profile/hcard
- hResume
- http://microformats.org/profile/hresume
- hReview
- http://microformats.org/profile/hreview
- rel-license
- http://microformats.org/profile/rel-license
- rel-nofollow
- http://microformats.org/profile/rel-nofollow
- rel-tag
- http://microformats.org/profile/rel-tag
- VoteLinks
- http://microformats.org/profile/vote-links
- XFN
- http://gmpg.org/xfn/11
- xFolk
- http://microformats.org/profile/xfolk
- XMDP
- http://gmpg.org/xmdp/1
- XOXO
- http://microformats.org/profile/xoxo
There are also shortened URLs for these profiles you can use. See the Microformats Wiki for a list.
And that's all you need. Now go update!
♥ Share the Love