Hugo Framework

5 min read

Hugo is a different kind of entry in this frontend lineup, because unlike React, Astro, or Tailwind, I didn’t adopt it for a client project with its own separate requirements — I built this entire blog on it, from scratch, with no imported theme, which means my Hugo knowledge is unusually deep in exactly the places a theme user’s knowledge usually isn’t.

Where I stand with it

Every template on this site is one I wrote — the post and project list pages, the single-article layout shared across posts, the Languages section, the footer’s dynamically generated /meta/ tree, the fake ops dashboards (status, metrics) documented in the “Playing With This Site” post, all of it. That from-scratch approach means I’m comfortable with Hugo’s templating language (Go templates, with all the {{ }} syntax and pipeline idioms that implies), its content organization model (sections, page bundles, front matter-driven params), its multilingual system (this site runs in Slovak, English, and Czech, with per-language content files and i18n string tables), and its build pipeline for assets — SCSS compilation, JS bundling and fingerprinting, all through Hugo Pipes rather than a separate Node-based build tool.

What I haven’t done: used Hugo with a third-party theme at all, which means I genuinely don’t know how good or bad the theme ecosystem’s code quality is on average, or built a Hugo site with the kind of extremely high page count (tens of thousands of pages) where Hugo’s build-speed advantages over something like Gatsby are supposed to really show. My site is small enough that I haven’t personally felt a build-speed ceiling, even though I believe the reports that Hugo’s speed matters more at a scale I haven’t reached.

What I think of it

The decision to build from scratch instead of starting from a theme was deliberate, and I think it’s the single choice that’s taught me the most. Themes are optimized for “get a good-looking blog running quickly,” which is a legitimate goal, and a different goal from “understand exactly how every piece of your site works.” Writing my own templates meant every weird, specific feature on this site — the footer’s tree view built from .Site.Sections, the roadmap page’s series-and-status grid, the tag-filtering JavaScript on the posts list — exists because I decided it should and built it myself, not because a theme happened to include it and I left it switched on.

Go templates, as a language, took longer to feel natural than I expected, specifically because the syntax is unusual relative to more common templating languages — the dot-context model (. meaning “whatever the current scope’s data is,” changing meaning inside a range or with block) was the single biggest conceptual hurdle, and I don’t think most Hugo tutorials explain it clearly enough before throwing you into real templates that assume you already have the intuition. Once it clicked, though, I found the model genuinely elegant for this specific use case — content-driven sites where the “logic” is mostly “take this data and lay it out,” rather than a general-purpose application needing a general-purpose templating approach.

The multilingual system deserves a specific mention, because building and maintaining a genuinely trilingual site surfaced problems I wouldn’t have predicted — a tag-link bug that assumed everything lived under /posts/, a footer SLA badge linking to a status page that didn’t exist in two of the three languages, section permalinks colliding because a title stripped of symbols slugified to the same string as a different page’s title. None of those are Hugo’s fault exactly; they’re the predictable cost of rolling your own multilingual templates instead of using a theme that’s already had those bugs found and fixed by someone else’s users. I don’t regret the tradeoff — I understand this site’s multilingual behavior at a level I wouldn’t if a theme had handled it for me — but I want to be honest that “build it yourself to understand it” and “build it yourself without bugs” are not the same promise.

Comparing it to the JavaScript-ecosystem frontend tools covered elsewhere — React, Astro, Next.js — Hugo occupies a genuinely different niche: no client-side framework at all by default, a Go binary doing the templating instead of a Node toolchain, and a build speed advantage that comes specifically from not needing a JavaScript runtime anywhere in the pipeline. For a content-first site like this blog, with no need for the kind of rich client-side interactivity the Dog Shelter Website’s filterable dog profiles need, that tradeoff is exactly right. I wouldn’t reach for Hugo for a project that actually needed Astro’s islands or React’s component model, and I think that’s a feature of having the right tool for each job rather than a limitation of either tool specifically.

Where I go to learn it

  • Hugo’s official documentation — genuinely excellent once you know roughly what you’re looking for, and noticeably less approachable before that point; the template-function reference specifically is where I live during any non-trivial layout work.
  • The Hugo Discourse forum — my primary source for the specific, weird edge cases that come from building without a theme — multilingual permalink quirks, taxonomy behavior, the kind of problem that’s too specific for the general documentation to cover but common enough that someone else has hit it too.
  • Mainroad and other well-written open-source themes’ source code, read purely for reference rather than installed — even building from scratch, reading how a mature theme solves a problem I’m stuck on has repeatedly been faster than reasoning from the documentation alone.
  • The Go text/template and html/template package documentation, one level below Hugo itself — since Hugo’s templating is built directly on Go’s own template packages, and understanding the underlying dot-context and pipeline model at that level clarified several Hugo-specific quirks that otherwise looked arbitrary.

Where this is headed

I expect to keep deepening rather than branching here, specifically because this site keeps growing new sections (the Languages pages, this very post) that each surface a new corner of Hugo’s templating system I hadn’t needed yet. The next real test is probably going to be whatever I build for Letterboxd Stats or the Dog Shelter Website’s next iteration — at which point I’ll have a genuine, rather than theoretical, basis for comparing Hugo’s content-first approach against Astro’s islands model on a project where either one could plausibly have been the right choice.