Thinking About “Person Mentions”

I’ve been thinking about how to implement Person Mentions on my website, and I think I’ve found nice way forward with web component syntax.

I often find myself mentioning a person in a post and wanting to link to their website in the post but link to their silo profiles on the syndications. (This kind of linking is “person mentions” in indieweb terms.)

For example, this link post:

Gathering Structures

There are not enough people organising events and running communities. We are deep into the historical moment of Bowling Alone. If you have any small spark within you that wishes to gather people around a shared topic or activity, act on it.

I found this highly encouraging. I don’t know if it will move me to actually organize something, but I love the motivation from Maggie. And who knows, maybe I will?? h/t https://adactio.com/links/20927

is syndicated to Mastodon as

“There are not enough people organising events and running communities. We are deep into the historical moment of Bowling Alone. If you have any small spark within you that wishes to gather people around a shared topic or activity, act on it.”

I found this highly encouraging. I don’t know if it will move me to actually organize something, but I love the motivation from @maggie@indieweb.social. And who knows, maybe I will??

h/t @adactio@mastodon.social

https://maggieappleton.com/gathering-structures

That conversion from “Maggie” to “@maggie@indieweb.social” and “https://adactio.com/links/20927” to “@adactio@mastodon.social” is handled manually right now. I first publish a version of the post with their mastodon tags and syndicate that. Then I edit my post to non-Mastodon-dependent names and links.

(Ideally “Maggie” would link to her website, but I don’t have HTML support implemented for bookmark commentary right now 🫤)

I thought maybe I could set up Person objects in my site and have some kind of syntax that gets processed before output or syndication. Something like “@Maggie” which would get converted to a link to a website when outputting to html, or to Mastodon handle when syndicating to Mastodon.

My hangup with that implementation is that the default output would be an unhelpful string. Processing would be required to make it useful. I already have non-functioning WordPress shortcodes littering old posts after moving off of WordPress.

I think, instead, I’ll implement the syntax as web components, something like:

<person-mention mastodon="@maggie@indieweb.social">
    <a href="https://maggieappleton.com" class="h-card">Maggie</a>
</person-mention>

With this, the unprocessed content would render as an HTML link. In my Mastodon-syndicating code, I can look for person-mention elements and replace with the value in the mastodon attribute.

As a bonus, it gives me contextual flexibility that a Person object wouldn't. For example, the hat tip to Jeremy because I saw the article through his shared link could be:

<person-mention mastodon="@adactio@mastodon.social">
    <a href="https://adactio.com/links/20927">Jeremy</a>
</person-mention>

I think technically this isn’t a person mention since I’m not linking to Jeremy’s homepage, but I like linking to the actual post through which I discovered the article. And then in syndicating to mastodon I can still link to his profile. Without this kind of context-dependent flexibility, I’d have to link to his homepage in the HTML version.

Even though there’s zero Javascript involved in this web component nor any client-side work, the way web browsers handle unknown elements seems like a nice way to implement a syntax for server-side content processing.