jlelse's Blog

Thoughts, stories and ideas

Hugo

TIL about vendoring Hugo modules

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.)

hugo mod vendor

Read more

Writing my own CMS in Golang?

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.

Read more

How my blogroll gets generated (now completely automatic!)

in 👨‍💻 Dev

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.

Read more

Cache Hugo modules in Drone CI

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: module: imports: - path: github.com/twitter/twemoji mounts: - source: assets/svg target: static/twemoji/svg The problem now is that Hugo needs to download more then 3000 SVG files from GitHub when there is no cache. And because my blog builds on Drone CI, each time in a new container, there’s no cache and the build time increased by about 10 seconds.

Read more

in 💬 Micro
Reply to: A note by Henrique Dias

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.

Read more

My own Static Site Generator

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.

Read more

in 💬 Micro

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.

Read more

in 💬 Micro
Reply to: A reply by Henrique Dias

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.

Read more

Eleventy

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.

Read more

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.

🖼️ Read more

Jan-Lukas Else