Hugo

The ActivityStreams module for Hugo should work with image attachments too. This is a test post to see how they are displayed on Mastodon. But I want to take the opportunity to introduce my readers to Unsplash, where you can find many nice photos for free use. Like this picture from NASA.

Mastodon doesn’t support “Article” posts and only shows the summary from them. But not only that, it doesn’t seem to unescape escaped HTML and that’s why articles from my blog looked so weird on Mastodon, while they worked fine on Pleroma and Microblog.pub. I now fixed the escaping. My Hugo module for ActivityStreams representation is available on Codeberg.

Hugo themes have the option to override the default rendering of Markdown images by using “Markdown Render Hooks” since version 0.62.0. By creating a file in layouts/_default/_markup named render-image.html it is possible to use a custom template for rendered images. This gives a lot of flexibility. I just used that flexibility to create a lightbox with pure CSS (without using JavaScript, like many lightbox implementations do). After clicking (or tapping) on an content image, you will see it filling the browser view.
I promised and people already asked, so here is the first part of the documentation about how I enabled ActivityPub support on my Hugo-based blog: The first step to enable ActivityPub support, was to get Hugo to generate ActivityStreams representations for posts and the ActivityPub actor. I did this by adding a custom output format and published the code as a Hugo module on Codeberg. See the README file there to learn about how to use it.

I just updated my blogroll and thought that it might be a great idea to share my workflow to do exactly that.

I use Miniflux a lot. Using Miniflux, I read all the blogs and get all the news, get updates from all the YouTubers and even subscribe to some Mastodon accounts (fediverse microblogs). I use multiple categories to sort the feeds. One of those categories is “Blogs” with all the blogs, which I also list on my blogroll.

After getting inspired by Kevin C. Coram, the blog is now generated by Hugo on a private Drone CI instance. Using a custom Docker image with Hugo, the site gets generated and the output is then uploaded to the server using rsync. Because this approach is much cleaner than my previous one, I could now also setup things like a preview page and I can update Hugo versions for my sites independently.

My IndieWeb setup is continuing to evolve. I just added support for syndication (this post should appear on IndieNews) and JSON-posting to my Hugo backend and theme. Unfortunately, adding support for more IndieWeb features to this setup requires a lot of documentation reading, reverse engineering and looking at how other people have done that (of course in other programming languages, one has not much knowledge in). All this effort is redundant, because there’s already WordPress with all its IndieWeb plugins.

I plan to add a bit of ActivityPub to my blog to be able to interact with the fediverse, without the need to use Mastodon, Pleroma or my current microblog. Just my static Hugo blog with it’s dynamic Go-backend. Because I don’t want to implement everything from scratch - I haven’t yet added media support for MicroPub - I am in search for libraries that help implementing ActivityPub, or at least give me a starting point. I discovered the library activityserver, which is used by a tool called pherephone by write.as, maybe that can help me.

What I still have to think about though, is how I’m going to connect it with the rest of the system. And what’s also still missing: The media endpoint and update support for MicroPub (I should do this first).

Or should I just cancel my plans with ActivityPub and wait until Fediverse software supports IndieWeb technologies? 🤔

Yesterday, I posted a link to a tweet by DHH on my blog. It’s about “Google tax”. Companies nowadays have to buy ads to appear on top for searches for their brand name. I submitted that post to HackerNews and it appeared on top of the front page within a few hours. Until some mods decided to change the link directly to DHH’s tweet. I’m ok with that, although it might not have been bad if a few more people had seen my list with Google alternatives.

I’m now receiving webmentions myself and also show them as “interactions” on this blog.

I implemented webmention receiving into my Hugo backend. Mentions are stored as a simple json file per webmention in the “data” folder of my blog and then I’m using some Hugo magic (data templates) to render them in my theme.

By doing it this way, I don’t need any JavaScript to show interactions and I don’t need to rely on a 3rd party service (I used webmention.io) for receiving anymore.

Jan-Lukas Else
20 years old student who writes about everything he cares about.