✺ articles.inqk.net

Usually more extended thoughts by Michael Camilleri.

Read how to use this blog.

TLDR

I added support to my blog for mentions that work across services.

Supporting Cross‑Mentions

I added ‘cross-mentions’ to my microblog this weekend. In Markdown, I can now write:

I'm @pyrmont:twitter.com on Twitter and @pyrmont:instagram.com on Instagram.

and it will be rendered in HTML as:

I'm <a href="https://twitter.com/pyrmont">@pyrmont</a> on Twitter and <a href="https://instagram.com/pyrmont">@pyrmont</a> on Instagram.

I accomplish this with a plug-in I wrote that transforms mentions of the form @username:domain into links of the form <a href="domain/username">@username</a>.

So far, so good. However, I took it a step further. I wrote another plug-in that cross-posts my blog updates to Twitter and, when it does, renders the text as:

I'm @pyrmont on Twitter and instagram.com/pyrmont on Instagram.

Doing this has the added benefit of removing the dependency I had on Micro.blog. Micro.blog looks pretty stable and I don’t think it’s going anywhere but I ultimately like being in complete control of the content I publish online and having my own cross-posting plug-in is consistent with that philosophy.

If you’re interested in the code, the entire website is available on GitHub. The Markdown plug-in is here and the cross-posting plug-in is here. ✺