representative h-card
(Redirected from representative hcard)
This article is a stub. You can help the IndieWeb wiki by expanding it.
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.:
How To
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
/twentyfifteen/inc/template-tags.php
or/twentyfourteen/inc/template-tags.php
- Search for the line with
author vcard
- On the same line, find the link
a class="url fn n"
- Add
rel="me"
to that link, so it looks like:a class="url fn n" rel="me"
- Save the template file
- Search for the line with
- If you are using the Twenty Fifteen or Twenty Fourteen theme as a single-author site, you can edit the theme file
Test
- Indiewebify.me has a test that validates representative h-card.
How To Discover
Either:
OR:
- Use a microformats2 parser to parse the page / site homepage into JSON
- 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.