representative h-card

The  representative h-card  for a page is an h-card on that page that represents that page, if any, as not all pages are about a person or organization, a page might not have a representative h-card.


 * For more info see: http://microformats.org/wiki/representative-hcard and read with translating hCard to h-card inline as you read.

Use Cases

 * How to discover a person's name and image from their homepage URL, e.g.:
 * When creating a blog post, link to a person, and have that link automatically use their image and name as link text.
 * After signing in with indieauth, finding the person's name and profile image

How To Publish
See:
 * how to publish: http://microformats.org/wiki/representative-h-card-authoring

How To Publish With WordPress

 * Twenty Fifteen / Twenty Fourteen theme
 * If you are using the Twenty Fifteen or Twenty Fourteen theme as a single-author site, you can edit the theme file  or
 * Search for the line with
 * On the same line, find the link
 * Add  to that link, so it looks like:
 * Save the template file

Test

 * Indiewebify.me has a test that validates representative h-card.

How To Discover
Either: OR:
 * Implement: http://microformats.org/wiki/representative-h-card-parsing
 * 1) Use a microformats2 parser to parse the page / site homepage into JSON
 * 2) Process that JSON with https://github.com/indieweb/representative-h-card-php which will return a small JSON structure with the representative h-card for the page

Consumers

 * Telegraph checks the URL of the person who logged in for a representative h-card to show their name and photo when logged in
 * The Webmention plugin for Craft CMS uses this to find the author during webmention processing
 * ...Please add examples of tools/services that consume it for their normal operation!

Libraries

 * https://github.com/indieweb/representative-h-card-php - Given a parsed mf2 document, returns the representative h-card for the page
 * https://github.com/indieweb/indieauth-client-php - When a user logs in, this library uses the representative-h-card-php library to also return a representative h-card of the user
 * IndieWeb Utils implements the representative h-card algorithm. View the docs for reference.