Changing the Storage of Cites on my Site

For a while now, I've wanted to tweak the way that my site stores contextual information about posts that it interacts with, such as Twitter interactions.

For RSVPs, I stored the cite data in an event property, which didn't make sense because it wasn't a real property, and also because it should've been an h-cite. For Twitter interactions, I had a context object in the Hugo post that was the full MF2 representation from Granary.

One concern I had with this was how to store it - I wasn't particularly looking forward to i.e. have the in-reply-to contain either an array of URLs, as usual, or an h-cite. This would make it particularly difficult, as both my server and theme would need to understand both, which adds a tonne of complexity.

I was having a look through Barry Frost's GitHub after noticing some interesting new developments on Micropublish and found Barry's content repo which stores all the data from his site.

I thought this was a great idea, especially the use of the folder structure to mirror the posts' own URL structure, as well as increasing visibility of how many interactions different domains had.

I've now implemented this on my site, using a similar structure, replacing any "unsafe" characters in the regex [^a-zA-Z0-9-] with _ to give me file-system safe paths, and to not nest directories due to Hugo not liking that structure.

This is really exciting as I'll be extending it to provide more context for all my posts, such as who authored it, and if possible the summary of the post as noted by the site.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#www.jvt.me #hugo.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.