Open jamietanna opened 2 years ago
My website marks up tweet handles and hashtags in text content via regexes in the view layer^1. I think this sort of transformation should be the client's responsibility, not the server's. The server stores and serves text; the client renders the post how it wishes.
Interesting, so I'd spent a while thinking about which way I wanted to go with it, and I decided that having it done Micropub-side means that I could own my hashtags (I've been meaning to blog about it for a while) so when I'm at an event tweeting about #PHPMiNDS
, I can easily go back to /tags/phpminds/
, because although the hashtags are technically for the final syndicated content, it's useful for my site too
I see. I've been a bit more specific about how I use categories/tags. I'll manually enter them in Micropublish when creating a note or other post types and then index them for lists, e.g. https://barryfrost.com/categories/indieweb
If the hooks are available for extension, I'd be happy maintaining the code in my fork, then its not enforced for everyone? I'd be wanting to add Micropub CRUD for the different options too, so it longer term won't just be "do the rewrite"
Currently, I have two main usecases in which my Micropub endpoint modifies the incoming request before saving it, which the latter of which would be quite key for me to move over:
Rewrite a twitter profile URL as an
h-card
:Mark hashtags in the post as
category
properties in the post itself, with some custom rules:#Java
becomesjava
(just lowercase'd)#SocialMedia
becomessocial-media
(split words on capitalisation)#IndieWeb
becomesindieweb
(custom rule)#FOSDEM
becomesfosdem
(all caps get treated as one word)(There are other cases, like "if I'm replying to Twitter, add a syndication link, but those are lower priority)