First Experience with Hugo
Hugo is a static site generator that turns markdown to html files that you can host anywhere. it’s very useful for people that don’t want the complexity of making and mantaining a site while leverages the markdown syntax.
Hugo has neat features like having an anchestor view from the opened file and you can customize alot of stuff within Hugo. I initially chose Hugo to generate my site because it has fast live rendering and I thought it would be an easy tool to use. But after using Hugo, I can see common problems people might have with it.
One of my main problem was to replace internal markdown links with
shortcodes which is a way to handle links within Hugo. In Short, you can’t just convert markdown links [example](example.link) directly. So all the links and images in markdown are kinda useless in Hugo. I didn’t know this going into Hugo and I was so close to rage quitting. We can work around this using
hooks. There are
built-in hooks inside Hugo, but I could never got it to work.
And starting out, I also need to know was how Hugo layouts work. It was quite confusing getting to know how Hugo layout its pages and how I should manage my assets or images. In the docs, it’s advised to put the images to a certain folder but I don’t really want that kind of way of managing files. So I just kind of put images wherever I want to, but that is also kind of pain in the butt.
Normally I would have my markdown in a layout similar to this
vault
├── attachments
├── Memo
│ ├── attachments
│ └── happy new year.md
└── Shower Thoughts
├── attachments
└── we live in a simulation.md
And that is also one of the default ways you can manage images in Obsidian. I tried using that directory layout but I was absolutely hit in the nuts.
In Hugo, every directory are lowercased by default, and spaces are replaced by dashes. so Shower Thoughts became shower-thoughts. which messes with the linking of images (with my hooks). It’s very weird to have something you intentionally title to messed around with.
Another thing I would like to mention is the pluralization of titles. This is enabled by
default so I had fun trying to figure out why it turning memo to memoes. I generally think the Hugo defaults are a bit egregious, considering a prespective to newcomers. I feel these kind of things should be what ever the user wants at the get go.
On the scale of things. I really like Hugo, it’s fast and very extensible. Although it has it`s quirks, I still enjoy using it.