-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add support for arbitrary post-rewriting middleware #24
Comments
My website marks up tweet handles and hashtags in text content via regexes in the view layer1. 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. Footnotes |
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 |
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)
The text was updated successfully, but these errors were encountered: