Skip to main content


After reading "Why you should write your own static site generator", I realized the build and deploy steps in my site is completely loaded with scripts (post-processing Hugo's output) and workarounds (such as using regex replaces for templating). And half the time I need to update something other than content I'll have to dig through the docs and forums.

Compare this with this one time I rolled my own SSG (for this single purpose), everything was centered around my build script and some shell tooling to move things around. I can make it output anyway I want, write templates in whatever format I like, place the content is whatever structure, and I just need to adapt my script for it. Well, granted this little project is much simpler than my site.

Is it really worth trying to adapt how I write to Hugo's framework, so it can generate an output closest to what I want, then use my own script to post-process the rest afterwards?

The main bottleneck right now that prevents me from rolling my own for my site (other than comparing "time pouring through Hugo docs" vs "time tweaking my new SSG") is the templating. This directly affect the tech stack I want to use. If I'm writing my own SSG now my best bet is probably Go + text/template + html/template to make my templates migration easier.

But at the end of the day, does having a smoother process of adding new features to my site actually make me produce better, more frequently updated content? Doubtful.

#ssg

#ssg
This entry was edited (6 months ago)
in reply to ~hedy

I have the exact same story with Hugo. Dozens of regex filters, post-processing with xmllint and then sed-based regex filters…

Hugo’s massive parallelism leaves it completely unfit for proper post-processing. It’s next to impossible to configure any of Goldmark’s low-level markup choices beyond what render hooks support (I have to use regexes to customize backlinks, for instance).

On the other hand, regexes work pretty well with known trusted well-escaped input. #Hugo

#hugo
This entry was edited (6 months ago)
in reply to Seirdy

Basically, Hugo is great for speed at the cost of full control over your markup without regexes.