Jan-Lukas Else

Thoughts of an IT expert

Tags: Hugo


TIL about vendoring Hugo modules

Published on in 💭 Thoughts

Today, I learned that it’s possible to “vendor” Hugo modules. By vendoring Hugo modules, Hugo will add all required module files to your site directory and use them when building your site instead of trying to download them first. No need for me to use a module cache on Drone anymore and two seconds less build time. (But 3000 additional files in my blog repo.)

View

Writing my own CMS in Golang?

Published on in 💭 Thoughts

After trying to write my own static site generator as an experiment, I now started to write my own CMS. Written in Go, SQLite as database (SQLite is awesome!) and focused on performance and simplicity. Currently I’m using Hugo with a number of dynamic additional services (for Micropub, Webmentions, ActivityPub, …), so it’s almost questionable why I use a static page generator at all. If I use my own lightweight and high-performance CMS, I could save myself all this extra stuff or at least reduce it in complexity.

View

How my blogroll gets generated (now completely automatic!)

Published on in 👨‍💻 Dev
Updated on

Yesterday I teased a new post about how I automated my blogroll generation by writing a Go script and using the Miniflux API. Here it is.

View

Cache Hugo modules in Drone CI

Published on in 👨‍💻 Dev

Today I modified my theme to use Twemoji for emojis. To add the SVG files to the theme, I used a Hugo module mount in the config of my theme:

View

Published on in 💬 Micro

That’ll be hard to do with Hugo. There’s no way to tell it to use absolute URLs in the feeds only. I’ll need to set up an extra step of some kind. I’ll check it out.

I use a partial in my Hugo theme to replace relative links with absolute links in the content in XML (RSS) and JSON (JSON Feed, ActivityStream) files. It has a regular expression to find and replace all relative links with their abolute version. It’s probably easy to modify to replace relative image sources too.

View

My own Static Site Generator

Published on in 💭 Thoughts

Because I don’t have enough side projects yet, I started programming my own static site generator, with the creative name GoBlog. I doubt it will replace my use of Hugo in the near future, but it is exciting to write a Go program that is designed for high speed. I get to know features that I have never used before. I also learn what to pay attention to when thousands of files have to be parsed and processed concurrently. Maybe I will never be able to use this project for anything useful, but side projects are mainly there to have fun or learn something useful.

View

Published on in 💬 Micro
Updated on

To give readers a bit more context, I’ve extended my Hugo theme so that it will be displayed below each post if it is mentioned or linked in another post on my blog. This increases the build time from about 7 to about 17 seconds (on my machine it takes 2 seconds, but it is also much faster than the VPS), but I don’t know how I can make it more performant. After all, for each article it is necessary to iterate through all the other articles and see if the content contains a relative link to the post.

Update: I disabled this again, because I don’t like this much increased build time.

View

Published on in 💬 Micro

I played a bit with 11ty today and came to the conclusion to stay with Hugo for now. Much of what Hugo brings with it (multilingual websites, taxonomies etc.) has to be done manually. Sure, 11ty is much more flexible and everything is somehow possible, but somehow it’s too much effort for me (at least for the moment). I have a working Hugo site and it would be best to stick with it for now and start thinking more about things I can blog about instead of just the site itself. And I should also focus on my studies…

Or maybe I should build my own static site generator? 😂

View

Eleventy

Published on in 🔗 Links

I’m currently browsing the docs of the static site generator Eleventy (also known as 11ty). Although I prefer Go and I’m not a big JavaScript (and npm) fan for various reasons, I now consider Eleventy as an alternative to Hugo for my blog. I’m reaching the limits of Hugo more often and have to find complicated workarounds, because it’s almost impossible to add custom functionalities to Hugo. Eleventy is apparently very flexible and can be easily extended.

View

Published on in 💬 Micro

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.

🖼️ View

Next

Jan-Lukas Else