Monograph: A Standards-First Hugo Theme for Technical Writing
I built Monograph from scratch in pure modern CSS with breakout grids, self-hosted assets, OpenTimestamps provenance, and Chrome E2E verification, then moved wjkoh.com onto it.
Contents
Most technical blogs fail one of two jobs. When a stylesheet narrows the page to a comfortable reading column, seven-column financial tables cramp and shell pipelines wrap mid-flag. When a stylesheet widens the container to fit code and charts, body paragraphs stretch past ninety characters per line and tire the eye within three paragraphs. Monograph solves both jobs with pure modern CSS, zero frontend build dependencies, and automated real-browser verification.
I built Monograph from scratch as a standalone MIT-licensed Hugo theme, tested every rendered page in headless Chrome across desktop, mobile, dark mode, and US Letter printouts, and migrated this site onto it today. Every post, table, callout, and OpenTimestamps badge on wjkoh.com now runs Monograph live, and the v0.1.3 release is submitted to the official Hugo Themes registry.
Pure Modern CSS Instead of Frontend Build Chains#
Static site generators stay fast when themes avoid heavy toolchains. Monograph ships zero Tailwind, zero Sass, zero npm packages, and zero !important rules in screen stylesheets. Hugo Pipes concatenates nine modular CSS files declared under a single explicit cascade line in 00-layers.css:
@layer reset, tokens, base, layout, prose, components, syntax, print;Layer order eliminates specificity wars across the entire theme. Base resets never fight prose rhythm, components never leak into syntax highlighting, and a site author can drop a small custom.css file into assets/css/ without wrestling selectors. Color tokens rely on native CSS light-dark() so light mode, dark mode, and automatic system preference share one palette definition across body copy, surfaces, borders, GitHub-style alert callouts, and GitHub Light and Dark Chroma syntax tokens.
Layout geometry runs on a symmetric five-track CSS Grid. Narrative paragraphs, headings, blockquotes, and footnotes stay locked to a 690-pixel reading column. Wide tables, code frames, long display equations, Mermaid diagrams, and figures tagged with #wide automatically span a 960-pixel breakout column on desktop monitors, then collapse smoothly to full viewport width with zero horizontal page overflow on 390-pixel phones.
Running a real-world dry run of wjkoh.com caught a subtle CSS Grid trap that static review missed. Grid items never collapse adjacent vertical margins the way standard block flow does. A bulleted list with a bottom margin followed by a horizontal rule and an h2 heading stacked three separate margins into a 147-pixel gap on /about/. Switching direct .prose children in 05-prose.css and 06-components.css to a single-direction margin-top flow cut that gap to a balanced 63 pixels and made spacing predictable on every page.
Typography, Mobile Ergonomics, and US Letter Paper#
Early prototypes of Monograph used Newsreader for body copy inside a 720-pixel column. Measuring the actual wrapped first line in Chrome showed 86 to 92 characters per line, well above the 50 to 75 character band recommended by Baymard Institute and classical typographers. Newsreader carries narrow glyph widths and a small x-height, which stretches line counts even at 20 pixels.
Switching the body serif to self-hosted variable Literata inside a 690-pixel column at 19.5 pixels on desktop and 18 pixels on mobile landed real rendered lines at 69 characters per line. Variable weight ranges in 00-fonts.css let headings, table headers, and definition terms interpolate natively rather than relying on faux bold synthesis. Mobile viewports tighten line height from 1.64 to 1.56 so narrower lines hold together cleanly, dark mode applies subtle optical compensation at weight 380 and 0.008em letter spacing to reduce light-on-dark stroke bloom, and inline code sits at 0.82em so JetBrains Mono matches surrounding serif proportions.
Print formatting receives the same engineering attention as screen rendering. Pressing print from either light or dark mode forces crisp black ink on white US Letter paper, hides navigation bars and interactive buttons, wraps long code lines so zero characters clip off the margin, repeats table headers across page breaks, and keeps headings glued to their opening paragraphs. Folded <details> disclosures and audio transcripts expand automatically before print and restore to their closed state afterward.
Self-Hosted Assets, Audio Subtitles, and Provenance#
External CDNs break offline archives, leak reader IP addresses, and inject supply-chain risk into personal publications. Monograph vendors every third-party dependency inside the theme repository: KaTeX 0.16.21, Mermaid 11.12.2, and five Latin variable .woff2 font files for Literata, Inter, and JetBrains Mono. Every vendored file is tracked in VENDOR_CHECKSUMS.sha256, every stylesheet and script tag carries a Hugo Pipes sha384 Subresource Integrity digest, and end-to-end tests fail if Chrome initiates even a single third-party network request.
Because browsers parse WebVTT tracks on <audio> elements without rendering visible subtitles, Monograph includes a zero-dependency {{< audio >}} shortcode for spoken essays and interviews. Hugo parses local .vtt cue files at build time into an accessible timestamped transcript, while vanilla JavaScript drives a live subtitle bar, a closed-caption toggle, and click-to-seek cue highlighting. When a reader prints the page, unplayable browser audio controls hide behind a crisp online-edition note and the full timestamped transcript prints directly beneath it.
For writers who anchor publication hashes to Bitcoin with OpenTimestamps, Monograph checks every page bundle for a matching *.ots file during the Hugo build. When present, citation.html reads the OpenTimestamps v1 binary header, extracts the exact 32-byte SHA-256 digest stored in the proof, and renders a compact provenance bar with a proof download link inside the citation card. Printed copies display the full 64-character hex fingerprint below the APA citation.
Every published page also serves AI coding agents and readers cleanly. Each article emits a raw Markdown twin at index.md advertised via an alternate link tag, the site root generates /llms.txt and /llms-full.txt, and pages flagged with noindex: true or unlisted: true automatically receive restrictive robot headers and stay excluded from sitemaps, feeds, and LLM corpora.
Testing a CSS Theme Like Systems Software#
Visual regressions hide easily in stylesheets because a one-line specificity tweak can silently break mobile tables, collapse paragraph spacing, or orphan a glossary term across a print page break. Monograph ships a zero-dependency two-tier test suite that runs locally via task test and in GitHub Actions on every push.
| Dimension | Minimal Starter Hugo Theme | Tailwind + JS Theme Stack | Monograph |
|---|---|---|---|
| CSS Architecture | Single unlayered stylesheet | Utility classes with Node build | Nine native @layer files via Hugo Pipes |
| External CDNs | Google Fonts and JS CDNs | Mix of bundled and CDN assets | Zero external requests, SHA-256 + sha384 SRI |
| Wide Data Layout | Fixed column or full-page scroll | Custom container overrides | Symmetric 690px prose / 960px breakout grid |
| Print Output | Browser default, clipped code | Often dark ink or broken cards | Forced white US Letter, wrapped code, expanded <details> |
| AI & Provenance | HTML and RSS only | Plugins or manual templates | index.md twins, llms.txt, JSON-LD, .ots SHA-256 |
| Automated QA | Manual spot checks | Build-only CI | Tier 1 HTML5/CSS/XML/RSS + Tier 2 Chrome CDP & PDF |
Tier 1 runs in Python via scripts/test_static.py across three Hugo build matrices: a subpath deployment with taxonomies, a root domain without taxonomies, and a minimal HTML-only config without RSS or LLM outputs. It validates strict HTML5 tag balance and nesting, zero duplicate IDs, materialized CSS syntax and font URL resolution, well-formed RSS 2.0 and Sitemap XML, WebVTT timestamp monotonicity, VENDOR_CHECKSUMS.sha256 integrity, and link targets.
Tier 2 launches headless Google Chrome over raw DevTools Protocol in scripts/test_chrome_e2e.mjs with zero npm dependencies. It verifies zero horizontal overflow across 18 route and viewport combinations, symmetric breakout geometry, 69-character desktop measure, real mouse-hover contrast above WCAG AA, interactive theme switching, live WebVTT audio cue seeking, CSSOM layer and font materialization, and US Letter PDF generation across every page and template.
Tradeoffs and Getting Started#
Monograph makes deliberate omissions to stay fast and maintainable. Using native light-dark(), @layer, and :has() targets modern evergreen browsers from 2024 onward rather than legacy compatibility shims. The theme also excludes analytics scripts, comment embeds, and client-side search from the core bundle; sites that need custom widgets inject them through three empty override partials named extend_head.html, extend_article_footer.html, and extend_footer.html without forking theme templates.
You can install Monograph as a Hugo Module with two commands:
hugo mod init github.com/yourname/your-site
hugo mod get github.com/wjkoh/hugo-theme-monograph@v0.1.3Git submodule installation, full hugo.toml reference configuration, and the self-contained demo site live in the Monograph repository, and every rendered pattern is live right here on wjkoh.com.