About three weeks ago I got auto-linked hashtags working on my posts.
The biggest challenge was picking a tag space to link my hashtags.
The second biggest challenge was figuring out how to get my linked hashtags to work when my posts were federated into Mastodon instances, and have them rewrite those links into instance-local tag page links. We need a term for such locally rewritten linked hashtags, perhaps “federated hashtags”.
While typical personal sites link a hashtag to a tag page that only displays personal posts, I wanted to link to something more like a tag aggregation page that also displayed similar posts from others.
The tag pages on Mastodon instances do a good job of this, showing tagged posts from any user on that instance, and tagged posts from any user followed by any user on that instance.
I reviewed my hashtags since the start of 2023, checked their pages on indieweb.social and found that the posts displayed were all on topic, and surprisingly free of tag spam (perhaps for now).
I chose https://indieweb.social/tags/ for my tag space (which is a 404 if you click it, where it really should display a tags page listing popular or recent tags or a tag cloud).
Combining a hashtag like #100DaysOfIndieWeb with a tag space produces a link to a tag page like: https://indieweb.social/tags/100DaysOfIndieWeb.
The other interesting thing about hashtag links is how they’re rewritten when a post is displayed on another Mastodon instance, to link to the tag page local to that instance.
This linked-hashtag-portability is underspecified unfortunately (it could probably use its own portable markup specification, or at least a best practice for h-entry publishing).
How it works in Mastodon is non-obvious enough that there’s a 4+ year old Bridgy Fed issue on the subject!
With a bunch of research and experiment contributions from several folks in the issue, @snarfed.org (@schnarfed) did eventually figure out how to get Bridgy Fed to federate hashtags in posts into Mastodon instances so they would rewrite hashtag links into instance-local hashtag pages:
Thus even though I’m using the indieweb.social tag space on the hashtag links in my original post, if you are reading this post on Mastodon, you should see a hashtag like #IndieWeb link to your local instance’s tag page for IndieWeb, and my post should show up on that page.
From testing a few other instances tag pages, this is now working, e.g. these tag pages:
* https://indieweb.social/tags/100DaysofIndieWeb (as expected)
display the #MozFest post¹ I published right after implementing linked hashtags (and any subsequent 100DaysofIndieWeb posts).
I did go back and send Webmentions to BridgyFed to send ActivityPub updates for all my past #100DaysofIndieWeb posts, however only a few of them showed up in those tag pages. It’s unclear why a few did and most didn’t, or why there are inconsistencies across instances. More to explore and debug.
Federated hashtags definitely need their own specification, because currently they barely interoperate when published, and even then require Mastodon-implementation-specific knowledge to function.
The good news is that several of us now have linked hashtags on our personal sites display and link as expected when our posts are federated across Mastodon instances, using a variety of different pieces of software to make it all work.
This is day 36 of #100DaysOfIndieWeb #100Days
← Day 35: https://tantek.com/2023/081/t1/mozfest-making-fediverse-socialweb
→ Day 37: https://tantek.com/2023/109/t2/years-ago-first-federated-indieweb-thread