Hugo

Thanks to AddToAny, there's now a “Share” option on my blog. If you find an article share-worthy, simply click on that link and select how to share this article. It should be pretty simple.

In Hugo I use the following line of code to create a share link:

<a href="https://www.addtoany.com/share#url={{ .Permalink }}{{ with .Title }}&title={{ . }}{{ end }}" target="_blank" rel="nofollow noopener">{{ T "share" }}</a>

{{ T "share" }} is a translation string, but if you don't care about translations, simply replace this with your preferred string.

I'm expanding my hugo-micropub endpoint all the time. My next planned features are:

  1. automatic webmention sending, probably by using Telegraph
  2. automatic posting to my Microblog.pub instance
  3. support for updating entries (I already built support for querying content items)
The great thing about my custom Micropub endpoint for Hugo is, that I can add all the features I need. Today I added a feature, that purges the BunnyCDN cache 10 seconds after a new entry got published. Sometimes it happens that I open its URL before the Hugo build is finished and then a 404 page gets cached. Currently Hugo needs around three seconds to build my blog (on the server, on my desktop PC it's even faster).
I can now make use of Micropub to post on my blog! More information: I am in search for an easier way to blog from the go for quite some time now. Recently, I implemented a web-based form to submit new posts using the API of my self-hosted Gitea. While that worked, it was still not optimal. I already heard of Micropub before, since I joined the IndieWeb, but I was always a bit scared of complexity to develop my own solution.

With PowerPoint, Keynote or Impress you can create nice presentations, but as a developer you might also want to version control your slides or create them with code. That's where Reveal.js comes in. You can create beautiful slides with Markdown and they get rendered nicely in the browser.

I already created some slides with Reveal.js, of which I also shared one online. I had a separate Git repository and a Netlify deployed site. But I wanted to get rid of that extra-site and embedded it directly into my homepage, which is a Hugo generated site, like this blog.

I found the reveal-hugo theme, which let's you easily create slides with Reveal.js and Hugo. All I had to do was to add the theme as a second Hugo module (the new way of adding themes or other site components, no more git submodules!) to my site, create a new output format (as described on the Github page) and add a new page with some extra frontmatter.

It's so easy!

I migrated that one published slide and also added a second one I had laying around (both are in German) and published them on my homepage at jlelse.dev/slides.

If this post is published on my blog, I successfully developed a nice piece of software that allows me to publish from wherever I go to my blog using just a web browser. Even from my smartphone! How this works? Just a small spoiler before I write a more extensive article: It's a form on a page of my blog and some client-side JavaScript that transforms the entries of that form and calls the Gitea API to create a new file.
Today I updated my blog setup to the new Hugo version 0.59, which includes nothing big, but several small improvements. In addition to that I finally added support for JSON Feed to this blog. JSON Feed is popular among IndieWeb folks and my feed reader Miniflux supports it too. Unfortunately it isn't yet supported natively by Hugo, so I needed to manually add it using a custom output format. I took a lot of inspiration from Jamie Tanna and his Hugo theme, as well as the tutorial from Arjen Schwarz.
Although I use Hugo heavily for this blog and all my other websites for more than a year already, I discover new (old) features from time to time. About new features I'm often informed, because I read the changelog whenever a new version gets published1, but there are still a lot of features that appeared before I started using Hugo. A few days ago, I discovered “related content” and implemented it into my theme right away2.
Jan-Lukas Else
20 years old student who writes about everything he cares about.