representative h-card

From IndieWeb
Jump to: navigation, search


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.

Contents

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

How To Publish

See:

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

Test

How To Discover

Either:

OR:

  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

Libraries

See Also

Personal tools
Namespaces
Variants
Actions
Recent & Upcoming
Resources
Toolbox