Reworking the blog for the #indieweb meant adding microformats2 classes to specific template areas in order to correctly identify the required content.
Nowhere is this felt more keenly than in the social element that ties much of the indieweb together: webmentions.
To be correctly interpreted a webmention needs a number of attributes:
- target URL: the location it is referencing,
- source URL: where it is coming from,
- the type of webmention: like, reply, RSVP, etc.
- the author: who is sending it, and
- the content: what the webmention is saying
Ive covered various parts of this before so won't retread that ground but I noticed one thing I had wrong: the content.
By wrong I mean that it included extra information that didn't need to be part of the webmention. The post meta.
WordPress, or more specifically the theme used, structures posts in certain ways so that it repeatedly, reliably includes the same information when running through the post loop.
Essentially my posts were formatted as article > entry > entry content & post meta. As well as inserting a
h-card for author, I had marked up entry as
h-entry and the entry content as
e-content but then realised that the post meta was held within the entry content div.
This meant the permalink code was included in the content sent to the target URL and not always getting display correctly.
Moving the post meta outside of the entry content solved the problem but meant I had to rework the CSS to keep it all looking like it should.