Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement canonical h-card parsing #21

Closed
aaronpk opened this issue Mar 30, 2014 · 4 comments
Closed

Implement canonical h-card parsing #21

aaronpk opened this issue Mar 30, 2014 · 4 comments
Labels

Comments

@aaronpk
Copy link
Member

aaronpk commented Mar 30, 2014

indiewebify.me seems to be assuming the first h-card on the page is the canonical h-card, which is often not the case.

On aaronparecki.com, the first h-card is usually the location of a recent photo.

@aaronpk aaronpk added the bug label Mar 30, 2014
@tantek
Copy link
Member

tantek commented Oct 6, 2014

indiewebify.me needs to implement representative h-card discovery.

See http://microformats.org/wiki/representative-hcard-parsing and think hCard -> h-card while reading etc.

@barnabywalters
Copy link
Member

Thanks so much for reporting this bug @aaronpk and for the help fixing it @tantek! The latest version of indiewebify.me handles the following cases:

  • A single, representative h-card being found
  • Multiple candidates for representative h-cards found, in which case the first is shown with a small warning mentioning that there were multiple
  • Single/multiple non-representative h-cards found, in which case the first is shown, with instructions for how to make it representative
  • No h-cards found

For example: http://indiewebify.me/validate-h-card/?url=http%3A%2F%2Faaronparecki.com%2F

@aaronpk
Copy link
Member Author

aaronpk commented Oct 21, 2014

Nicely done! Works great on one of my notes: http://indiewebify.me/validate-h-card/?url=http%3A%2F%2Faaronparecki.com%2Fnotes%2F2014%2F10%2F20%2F4%2F

Does this mean my site should be including a rel=me property of "http://aaronparecki.com/" on every page so that when there are multiple h-cards it knows which to use as the canonical?

@barnabywalters
Copy link
Member

@aaronpk seeing as rel=me creates a page-level relation, it’s not really appropriate for use on pages other than the homepage — typically you should be using authorship markup of some sort on pages other than the homepage.

The representative h-card algorithm finds, on pages representing an h-card (but which might have other content on), the h-card that page represents. On pages representing other things, e.g. an event or post, the authorship algorithm is more appropriate.

Currently indiewebify.me only partially implements the authorship algorithm, but with the recent improvements to barnabywalters/mf-cleaner it’ll be trivial to improve this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants