Skip to content

1 - A gallery view for blog posts

Turn a blog section into a wall of linked covers, with three arrangements and captions that work on phones and keyboards.

Sometimes the cover is the quickest way to recognize a post. A travel journal, a collection of sketches, or a set of project notes can be easier to browse as images than as a column of titles.

OINK 1.4.0 adds a fourth blog view, gallery. Each post becomes a linked cover. The default arrangement joins images into rows; hovering or focusing a cover reveals its title and description. Clicking it opens the article.

Released in OINK 1.4.0

Gallery is part of the released theme. It keeps the ordinary blog article model and adds a cover-based way to browse the same posts.

Four ways to browse the same posts

The existing views answer different browsing needs. A table is useful when you know the date or title. Rows give summaries room to breathe. Cards put the cover and article metadata together. Gallery gives most of the space to the cover.

Blog view What the reader sees
list Horizontal entries with a thumbnail, metadata, and summary
cards A regular grid with 16:9 covers and article information
table Compact date, title, and tag rows
gallery Covers arranged by proportion, with titles and short descriptions

With the view switch enabled, all four forms use the same page of posts. Changing the view keeps the date order and current pagination slice. Readers can scan the covers, then switch to a table without losing their place in the archive. A standalone table still lists the whole section when switching is disabled.

Borrowing Expo’s layout

Expo already arranges images into a wall. Blog gallery reuses that row calculation and the same compact layout controls. The content still comes from ordinary blog pages: the featured image is the cover, the page title names it, and the description supplies the caption. There is no second album manifest to keep in sync.

The destination matters. An Expo tile opens an image viewer; a blog tile opens its article. A post with manual_link keeps that external destination. This makes the gallery useful as an index of writing, including short visual notes whose cover carries much of the story.

Inside Gallery, readers have three arrangements:

Arrangement Layout Captions
wall Rows with 6px gaps Revealed on hover or keyboard focus
seamless The same rows with no gaps Revealed on hover or keyboard focus
cards Masonry, placing each entry in the shortest column Always visible below the image

The gallery’s cards mode is the masonry arrangement, separate from the blog’s regular card view. A size slider changes the target tile size from 160 to 360 CSS pixels. Gallery remembers these choices separately from Expo, so changing a blog index does not rearrange an album on the next page.

Give captions room on a phone

A caption that only appears on hover is of little use on a touchscreen. On devices without a fine pointer and hover, Wall and Seamless put the text below the image. The layout reserves the tallest caption’s height for each row, so the following row cannot cover its links or text.

Very tall images need another adjustment. If their tiles preserve the exact source proportions on a narrow screen, the caption can shrink to a few characters per line. Below 500px of gallery width, we bound tile proportions more tightly. The full image remains visible inside its tile, with some empty space where necessary. That tradeoff keeps the text readable without cropping the cover.

Keyboard focus reveals the same caption as hover and adds an inset focus ring. The link has the article’s title as its accessible name. A post with no cover remains a clickable title tile; a failed image receives the same fallback. Without JavaScript, the page shows a responsive grid with visible captions and ordinary links.

Add these fields to a blog section’s _index.md front matter:

content/blog/_index.md
blog_index: gallery
blog_index_toggle: true
blog_index_size: 24
blog_gallery:
  mode: wall
  size: 240

blog_index chooses the initial view. blog_index_toggle lets readers cycle through all four views; set it to false to publish only the gallery. blog_index_size controls the number of posts per page, while blog_gallery.size controls the target tile size. They are independent.

For site defaults, put the same keys under params.ui:

hugo.yml
params:
  ui:
    blog_index: gallery
    blog_index_toggle: true
    blog_index_size: 24
    blog_gallery:
      mode: wall
      size: 240

A page or section cascade can override the site defaults. A blog_gallery block replaces the whole site block, so repeat both fields when you want to keep both settings. Existing bundled featured images and the images field continue to supply covers.

This configuration applies to the theme’s native blog section indexes; custom homepages and term templates must call the gallery partial explicitly.

Keeping the implementation small

The theme processes suitable large covers into previews within a 960 × 960 box, preserving their proportions. GIF covers use still previews. Images load lazily, including when a hidden view first becomes visible. Local covers require no remote image service or additional browser dependency.

Gallery has its own small runtime and reuses Expo’s geometry helper. It recalculates when a view becomes visible, the available width changes, fonts settle, or an image reveals its dimensions. These events matter more than the first screenshot: a layout can look correct initially and overlap after the sidebar moves or the reader changes views.

The checks compare article order across all four forms and across page boundaries. Browser coverage includes English and Chinese, desktop and touch, light and dark, keyboard navigation, missing covers, blocked images, and JavaScript being disabled. The parameter reference lives in the blog authoring guide, and the design decision records the ownership and content boundaries.

2 - Documentation-Driven Development: The First Secret to AI Software Engineering

How to keep AI-generated code maintainable: documentation-driven development, adversarial review, brute-force testing, and complexity penalties — and why Oink was built for it.

Documentation is not an afterthought once the code is finished. It is an input before coding begins, working memory during development, and the acceptance standard at delivery.

A few days ago, I wrote AGI Machine Guns Are Now Standard Issue, about how I burned through more than a dozen AI subscriptions in a month and pushed a backlog of projects forward. The most common question in my inbox and comments was not “Which model is best?” It was: How do you keep all that AI-generated code from becoming a mountain of crap?

It is the right question. Once everyone has a machine gun, anyone can spray bullets. But writing code quickly does not mean building good software, much less software that will still be maintainable six months later. So I want to share the techniques and lessons I have developed over the past few months of engineering with AI.

There are four: documentation-driven development, adversarial review, brute-force testing, and complexity penalties. Sometimes the bluntest techniques work best. Any so-called secret sounds obvious once explained—but that does not make it any less effective.

This essay focuses on the first: documentation-driven development. It is the foundation for the other three, and the practice in which I have invested the most—so much that I ended up building a documentation framework specifically to put it into practice.

Wishing and Design

I originally planned to begin with theory, provide some background, and then move on to practice. That felt needlessly elaborate. Let me start instead with the main problems I encounter when using AI to build and maintain medium-to-large software projects.

I call the first problem “wishing”: stating clearly what you actually want. For a small demo, almost any approach will do. For a software project of medium size or larger, this takes real skill.

You cannot simply tell an AI, “I want a database that runs on object storage,” or “Rewrite Patroni in Go; rewrite pgAdmin too.” Those wishes are too high-level. AI has not yet reached the point where a single sentence like that produces the entire system. The space in between contains a great many engineering details and architectural decisions, and you still have to make the calls yourself.

Wishing is the part of the entire process that demands the most effort from you. State the wish well enough, and an agent can run for days, implementing it piece by piece without your constantly adjusting or directing it. State it vaguely, and however energetically the agent runs, it is still running in the wrong direction.

What form should the final “wish” take? I think it should be a PRD—a product requirements document. Human involvement is essential here: you describe the requirements, the agent organizes them into a PRD, and then you read that document carefully.

You may choose not to read the code, but you cannot choose not to read the requirements. Only you can decide what you actually want.

If an entire PRD feels like too much, at least read its user stories. Have the agent describe the typical usage scenarios, then ask yourself: “Is this what I want?” Point out any mismatch and iterate until you can say, “Yes. That is it. Go build it.”

Take it from me: never, ever skimp on this step. Every shortcut you take here comes due later. Start building before you have described the requirements clearly, and the result is pure luck—a gacha pull. That is not necessarily a problem for a small project. Sometimes your first pull gets you 90% of the way there—you hit a top-rarity SSR. It happens. But engineering cannot run entirely on luck. If you can settle a choice during design, do not defer it until later.

Exploratory work is different. If you genuinely do not know which approach is good, some uncertainty is unavoidable. But you can at least narrow the viable search space and keep the agent from producing anything wildly unreasonable.

How much time should this take? In my experience, a medium-sized project deserves at least half a day—a full morning—to generate and review the PRD before implementation begins. Once that is done, let the agent run and burn through the subscription quota. Come back a day or two later for acceptance.

Development and Repair

The second problem arises during development. Coding agents are not like human engineers; they have their own temperament. The simplest way to think of one is as an amnesiac genius.

Imagine hiring an exceptional engineer. They can write in any language, pick up any framework at a glance, and do a week of an ordinary engineer’s work in a day. But every morning, they arrive having forgotten everything from the day before. They no longer remember why the project was designed this way, which approaches failed, which traps the team fell into, or which gaps were deliberate. You have to explain it all again from scratch.

Human teams have always compensated for this problem informally. Veterans teach newcomers and recount old project lore over lunch. During code review, someone casually explains, “We wrote it this way back then because…” The knowledge that never made it into the code but genuinely keeps the project running has a name: tribal knowledge.

An agent has no tribe and cannot join you for lunch. It has only three things to rely on: code, tests, and documentation.

This is one substantive change AI programming has brought. Documentation used to be supplementary material written after the code. Now documentation begins as an input before any code is written. Poor documentation once meant little more than a slower onboarding process for new engineers. Today, it can send an agent in the wrong direction, causing it to reimplement an approach you rejected long ago—and to implement it rather thoroughly, expending enormous effort on work that solves the wrong problem.

My answer is simple: give the agent working memory. But I emphatically do not mean lame-ass gimmicks like “install an MCP” or “install Claude Mem.” I mean managing working memory as documentation.

Left to itself, a coding agent will crap out stray Markdown files all over a project: a PLAN.md here, a NOTES.md there, plus a pile of TODO entries. Instead, make two requirements explicit:

  1. Preserve the full reasoning process. Keep the raw record in the working directory, organized chronologically or by topic, with the complete process intact.
  2. Periodically summarize and index it. Have the agent turn its prior working memory into an index in AGENTS.md or CLAUDE.md, recording what earlier threads and sessions did. When a similar problem appears later, it can revisit earlier reasoning and architectural decisions instead of repeating old mistakes.

Both layers are essential. You cannot put everything in one giant pile, so the top layer needs an index. But an index alone is not enough; the complete raw records must remain underneath it.

Testing and Acceptance

The third problem is testing and acceptance.

Tests come in different tiers: unit tests, integration tests, and acceptance tests are not the same thing. Given the intelligence of current AI systems, I do not even look at unit or integration test code. Unless a change touches an especially critical path or breaks compatibility, I let the agent test its own work and report the results, then apply my second technique—adversarial review—as the quality gate.

Only when two top-tier agents review each other’s work and still cannot agree do I step in personally. That is already rare.

But there is one thing you cannot delegate: acceptance testing. Is what the agent built actually what you wanted? You obviously cannot tell the AI, “Do the acceptance testing for me.” You cannot outsource supervision and sign-off. If you will not even do that much, chances are overwhelming that what you get is garbage.

Acceptance means staking your own reputation on the result. A responsible engineer cannot cut corners here.

So how should you conduct acceptance, and how much work can you safely avoid? You can ask AI to draft the acceptance plan.

This is where documentation starts to earn its keep. Work backward from the user: who will use this software? It may be a human or another agent.

If it is a human, how do people normally start using software? They probably visit your site, click Get Started, and follow a tutorial from the basic features through the core workflow. That is the standard pattern.

So require the agent to deliver more than code. It must also deliver instructions and a manual, maintained to the same standard as the code itself. Acceptance then means following that manual: does Get Started actually work? Can you really complete every step in the tutorial?

Documentation-Driven Development

Once you examine those three stages, the conclusion becomes clear: coding with AI is fundamentally an exercise in context management. That is admittedly a truism—using an AI agent for anything is fundamentally about context management. But in software engineering, what exactly constitutes that context? Two things: code and documentation.

If the code is already highly self-describing and expressive—pure Python, plain scripts, self-explanatory formats such as YAML and DSLs, or simply a tiny project—you may not need separate documentation. But if you are writing Go or Rust, or building a complete medium-to-large project, documentation is essential.

My conclusion: treat documentation as seriously as code—perhaps even more seriously.

Documentation falls into several categories:

  1. Design documents: goals, constraints, proposed approaches, boundaries, and architectural trade-offs;
  2. Working-memory documents: the two layers described above—the complete raw record and a periodically updated index;
  3. Reference and delivery documents: reference material explaining how the system works, tutorials that guide users through complete workflows, release notes for each version, and decision documents recording architectural trade-offs.

How should you manage all these kinds of documents? You could dump them into a directory and ask an agent to summarize what it contains, but that is crude.

The key is this: documentation must be easy to ship. It is part of the deliverable, not a pile of internal scratch notes or something tossed casually into Obsidian or a cloud notebook.

From the first day of a software project, understand that you are shipping not only a binary but also documentation. They are equal deliverables. If the documentation must ship, write it properly from day one and manage it with a proper system.

My approach is to give every project a companion documentation site. You can keep a docs directory in the project or split it into a separate repository; I prefer a separate repository.

For these sites, I built OINK, a Hugo theme based on Google’s Docsy, with extensive customization and integration. It has three main advantages:

  1. Simple delivery. It supports turnkey CI/CD on GitHub Pages and Cloudflare Pages. Commit and push, and the documentation site builds and publishes automatically; there is no pipeline to babysit.
  2. Everything you need. Code blocks, tabs, steps, diagrams and charts, formulas, file trees, full-text search, multiple languages, version switching, and backlinks for knowledge management are all built in. You can ship a polished documentation site immediately. Every page also has a plain Markdown version, and the whole site exposes llms.txt: humans read the rendered pages, while agents fetch Markdown directly from the same source.
  3. Minimal friction. No giant npm frontend stack. A single Hugo binary builds the entire site offline at blistering speed; even a site with thousands of pages builds almost instantly, with live preview. If native Markdown can express something, OINK never reaches for a flashy component.

Why Good Documentation Matters

Why invest so much effort in documentation? Who is it actually for?

First, put yourself in the user’s position. If a person or an agent wants to use your software, what will they do first? They are hardly going to poke at a binary until they figure it out. That is one possible model—another project of mine, PIG, follows it by embedding documentation in the binary and exposing structured documentation directly through help. The design is explained in Agent-Native CLI. But I do not think this is a general solution. In most cases, users will start with your documentation.

Second, documentation is not only for users. It is also for you, and it is your most important acceptance standard. Few people will inspect AI-written code line by line. You may choose not to read the code, but you must at least read the documentation. If an AI has cobbled something together and you do not have time to test every detail by hand, you should at least inspect the accompanying reference documentation.

Today’s coding agents already perform like brilliant, expert engineers. Your role is that of a senior architect: assign work and accept the result. But agents are not yet intelligent enough to take any grand wish you casually make and implement the whole thing automatically.

That leads to one point I consider critical:

If you care about engineering quality, at least 70–80% of your tokens should go to quality control and testing, not writing code.

Writing code is fast and does not consume many tokens. Exhaustive testing is what really burns tokens—and what raises quality. This is a defining feature of AI software engineering: AI can give you a result worth 70 or 80 points out of 100 in one pass, but you may spend 80% of the total cost earning the last 20 points.

If you want to ship something genuinely reliable—something others trust, something widely used, and something you trust yourself—this is not the place to economize. Know where you can cut corners and where you cannot.

You can be lazy about unit tests: there is no need to write them by hand or read them routinely. You cannot be lazy about whether the project is headed in the wrong direction or the architecture contains any profoundly stupid design choices. When you spot either, intervene promptly (steering) and pull the work back on course.

Conversely, if a project cannot deliver documentation of acceptable quality, I consider the project itself unacceptable.

The clearest example is my friend Jiang. As I described in the previous article, he is the gorilla with a machine gun who cobbled together five databases, an operating system, and a compiler. Recently he added an OLTP database built on object storage.

Objectively, that database may solve a real problem in some particular setting. Overall, however, it still belongs in the garbage category. Why? Because it has no decent documentation. Without documentation, nobody knows what it can do, where its boundaries lie, or how to sign off on it.

A Concrete Example: Silo

After all that theory, consider a concrete example: Silo.

Silo is a MinIO fork that I maintain. Upstream eliminated the community edition, gutted the management console, stopped publishing binaries, and archived the repository; Silo keeps all of those things alive. It is now the most active MinIO fork, with 600,000 downloads and more than 2,500 stars, and many open-source projects have switched their default image to it.

How do I maintain it? For every issue, I create a design document that captures the complete design rationale and reasoning process. I consider this essential. When you use AI to build such a critical piece of infrastructure, most people’s first reaction is, “Can its quality really be trusted?”

So you have to record everything: what problems did we encounter? How did we reason about them? How were the critical decisions made?

Silo’s FAQ states the policy plainly: agents do most feature development and code review; every change must pass CI and human review; every substantive change is merged only after a human weighs its trade-offs; and the agents’ complete work logs and trade-offs are archived. When a fix later proves wrong, the thing you most want to know is why it was made in the first place.

I believe the session log is the real asset a project accumulates. Code records the what and the how. The why must appear in the documentation—or at least in comments.

These records are rarer and more valuable than the code itself. They turn the tribal knowledge described earlier into a durable project asset. Silo’s dozen-plus security advisories and release notes are the public output of this practice. Read them and judge for yourself.

One more point: for medium-to-large projects, the right approach is to move quickly in small steps. Do not try to cobble together one giant system in a single shot. Break the work into small units that can be accepted independently. Complex architectures evolve; they are not designed in one pass. That evolutionary history matters enormously.

Take PostgreSQL. Its code is valuable, but I would argue that its soul does not live in the code. It lives in thirty years of community mailing lists and in its exceptionally good documentation. After all, most users may never read PostgreSQL’s source code, but they will almost certainly consult its manual.

What Comes Next

Beyond documentation-driven development, software engineering has a few classic techniques. I find three especially useful: adversarial review, brute-force testing, and complexity penalties.

Their principles are utterly straightforward, but simple ideas are often the most durable. As for elaborate, kitchen-sink skill suites such as BMAD and Superpowers, I no longer use them this season.

I consider BMAD pure overengineering. It takes all the bureaucratic cruft of software engineering that may make sense for human teams and ports it unchanged to agents. Agents do not need such fine-grained division of labor. At this stage, two or three agents in adversarial roles, reviewing one another, are enough. Every agent is a generalist; just give two agents opposing briefs. That is enough. There is no need to split them further into product manager, architect, and test engineer.

Of course, this is only my experience from the current season, which began in July 2026. These days I go all-in on the strongest tier of models, use only the best, and never waste time on cheap little models. My rule is simple: use the best tools for the hardest work. That is why I burn tokens so quickly—an average of two and a half subscriptions a day. Even Tibo’s wild Reset spree and several accounts in rotation are not quite enough. Only Saint Tibo’s Resets keep me afloat.

The next model release may change best practices again.

For now, I see two patterns worth exploring.

Pattern One: Agents Enter Team Chat

One approach is to connect Claude to Slack through Claude Tag. It can see your chat history and discussions, and you can assign it work much as you would to a human colleague. Most importantly, it gains access to the “tribal knowledge” context described earlier. There is something genuinely interesting about assigning work with @Agent in a group chat. I think it is a promising model for humans and agents to coexist, interact, and collaborate.

Pattern Two: A Super-Orchestrator

Tibo says the next major paradigm will be a highly capable orchestrator—Astra—directing a fleet of worker agents. I think that may be a better direction. According to Tibo, Astra will bring another enormous leap when it launches. Most people’s local machines may not even be able to run it; it may require a cloud-hosted machine.

I had considered burning one into existence for myself, or tinkering with an existing open-source project. But why waste time on that? Wait another two weeks and the official team will ship one. There is really no need to tinker, is there?

I will cover how the other three techniques—adversarial review, brute-force testing, and complexity penalties—work in practice another time.

Final Thoughts

This essay has focused on what documentation-driven development looks like in practice, with a concrete example.

My OINK framework has also recently stabilized. Version 1.0.0 is now out with all the essential features in place, and I have just submitted the theme to the official Hugo theme registry.

Using it is brutally simple: tell Codex or Claude, “Use the pgsty/oink Hugo theme.” It will clone a starter site, edit the content, build it, and deploy it. You only have to write Markdown. Several friends are already using it to build documentation sites inside their companies.

Shipping a polished documentation site that works out of the box is far better than handing over a few scattered Markdown files crapped out across the repository.

I now build almost all my projects in public. Visit any of the sites below: their design rationale, release history, and contracts are all there as practical examples.

Code can be wished into existence. Quality cannot. Documentation sets the boundaries around the wish—and provides the evidence you need when it is time to sign off.

3 - Oink: Build Modern Websites with Markdown

A couple of weeks ago I wanted a decent documentation theme for a few new projects; a couple of weeks later I migrated all 18 of my production sites to Oink.

A couple of weeks ago, I just wanted a decent-looking documentation theme for a few new projects.

A couple of weeks later, I had migrated all 18 of my websites to it.

Pigsty’s Chinese and English documentation, Silo, PIG, SOW, PG Exporter, the company homepage, my personal blog, and multilingual books such as Designing Data-Intensive Applications now all run on the same framework.

Image

This was more than a fresh coat of paint. Those eighteen sites differ in structure, language, scale, and purpose: large technical manuals with over a thousand pages, small tools with just a few, blogs, books, download sites, and landing pages built purely to introduce a product.

Moving them all was a substantial undertaking.

But the strongest endorsement an author can give a tool isn’t a list of features in its README or a pile of GitHub stars. It’s whether they’re willing to put everything they run in production on it.

I have. So I think Oink is finally ready for a proper release.

ImageImageImageImageImageImageImageImage

What is Oink?

Oink is a local-first Markdown documentation framework that works out of the box.

You need three things:

Markdown.

A Hugo Extended binary.

A Git repository.

Together, they give you a complete, modern website with search, printing, light and dark modes, multiple languages, and versioned documentation. Deploy it to GitHub Pages, Cloudflare Pages, Nginx, or any static server, and publish updates with a Git push.

The build needs no Node.js, npm install, PostCSS, external CDN, or persistent backend service. Fonts, styles, icons, and interactive runtimes ship locally with the project. A single hugo command produces a complete directory of static files. You can build and serve it offline.

Of course, you can also leave all of that to Claude or Codex.

Image

You can call it a Hugo theme, but I think that undersells it. I prefer a documentation distribution. A typical theme answers “What should the page look like?” Oink addresses the whole system:

  • How to organize content.
  • How documentation, blogs, and books can coexist.
  • How to handle search, navigation, languages, and versions.
  • How to author technical components.
  • How to deliver the same content to browsers, printers, and AI agents.
  • How to build, check, deploy, upgrade, and maintain a site over time.
Image

In other words, this is more than a new face for Docsy. It packages the lessons, judgments, and components I’ve accumulated over years of maintaining engineering documentation into a complete publishing workflow.

Markdown in, Modern Docs out.

That’s Oink’s core idea.

The name is simple, too: Ink for writing and documentation, Oink for the pigs in the Pigsty family. Treat the README’s Open, Indexed, Navigable, Knowledge as a bonus backronym.

Why now?

Because writing code has become remarkably fast.

Building the functionality used to take most of the time when starting an open-source project. With Codex, Claude Code, and other agents, a prototype can now emerge in an afternoon. Repositories, tools, components, and small products are multiplying.

But finishing the code is only the beginning.

You still need a README, installation instructions, configuration documentation, release notes, and API documentation. A blog and product homepage would help, too. Without them, the code exists, but people don’t know what it is, what problem it solves, how to use it, or where to find answers when something breaks.

AI has drastically reduced the cost of producing code. It hasn’t removed the need for documentation. It has created more things that need explaining, organizing, and delivering.

Documentation is shifting from an afterthought to an increasingly visible bottleneck in shipping a project.

Image

Meanwhile, Markdown is taking on a new role.

We used to describe it as the common format programmers use for documentation. In practice, it has become a shared protocol between people and AI agents. READMEs, AGENTS.md, skills, task descriptions, project memories, design documents, knowledge bases: more and more information ends up in Markdown.

That is a significant change.

Earlier documentation frameworks focused mainly on rendering content for people in a browser. A modern documentation system also needs to ask:

  • Can AI read the content directly?
  • Can it be copied without losing information?
  • Does each page have a clean Markdown version?
  • Does the site have an index machines can discover?
  • Are the source files cluttered with syntax that only matters to a particular frontend framework?

Oink generates a corresponding .md version of every page and an llms.txt index at the site root. It provides “Copy as Markdown,” “View Markdown source,” and optional “Open in ChatGPT / Claude” actions. These are static build outputs: they need no extra service and don’t quietly upload your content anywhere.

So Oink does more than claim to “support AI.”

Its content model starts from one assumption: the documentation must serve both human readers and machines.

I’ve had enough of modern documentation frameworks

There is another, simpler reason I built Oink: I was fed up with the available documentation frameworks.

They work, and some are excellent. But they tend to demand tradeoffs I’m unwilling to make.

MDX: expressive pages, framework-specific content

First, there are the frameworks built heavily around MDX.

I understand the appeal. You can drop React components directly into Markdown and render almost anything you can imagine.

Image

The cost is just as clear: content and presentation logic become entangled.

Component tags, attributes, nested containers, imports, and other framework-specific constructs gradually spread through the documentation. Eventually, it looks less like Markdown and more like JSX wearing a Markdown disguise.

Image

That creates three problems.

First, people reading the source have to wade through noise.

Second, AI agents waste context on presentation details unrelated to the content.

Third, when you want to change frameworks, the lock-in reaches into the content itself.

I’ve always believed that presentation should have a light footprint in content.

Content is a long-term asset; a theme is something it wears for a while. Encoding words that will still matter in ten years in a frontend framework’s private DSL just to get a nice tab panel today is a poor trade.

Node.js: maintain a frontend project before you can write docs

The second problem is the modern frontend toolchain.

You want to write a few pages of documentation. Instead, you first acquire a package.json, two lockfiles, hundreds of megabytes of node_modules, a bundler, plugins, theme packages, and a string of version constraints.

Even when the result is just static pages, building them increasingly feels like maintaining a frontend application.

This is no inherent fault of Node.js. These tools earn their place in complex web applications. For documentation, though, I often find them excessive.

Documentation should be the part of a project that is:

  • Easiest to build.
  • Easiest to move elsewhere.
  • Easiest to preserve offline.
  • Least likely to break after a dependency update.

Instead, the opposite happens.

The code still compiles, but the docs site breaks over a plugin, lockfile, or build environment. You want to fix a typo and first have to work out why today’s build behaves differently from the one six months ago.

I don’t enjoy that.

Lightweight tools fall short; full-featured ones look dated

Lightweight tools such as Docsify are simple. But once you need extensive navigation, multiple languages and versions, printing, SEO, complex components, book cross-references, and a complete publishing workflow, you soon reach their limits.

Docsy has the opposite problem. Its content model and engineering are mature: Google started it, and many CNCF projects use it. But the default interface looks dated, and parts of the implementation still carry baggage from an earlier era of frontend development.

Image

I’ve also used Hextra and Blowfish, and I like both. Hextra works well for documentation and books; Blowfish works well for blogs. But with more than a dozen sites to maintain, I don’t want three content dialects, three configuration systems, and three sets of customization logic.

ImageImage

My requirements became clear:

Is there one framework for documentation, blogs, books, product homepages, releases, downloads, and API references that still uses plain Markdown, builds static files, works locally, and remains maintainable over time?

Nothing quite fit.

So I built one.

Oink’s answer: keep content clean and put complexity in the framework

Oink began with the needs of more than a dozen real websites, rather than a visual mockup.

I collected the capabilities those sites actually needed, then looked for the simplest, most stable abstractions they could share.

A few clear principles emerged.

First: prefer native Markdown

Oink’s first principle isn’t “no components.” It’s this:

If native Markdown can express it, don’t invent new syntax.

A step list, for example, is still an ordinary ordered list. Add one line of attributes after it:

Step list source and rendered output

Outside Oink, it remains an ordered list that people and other Markdown tools can read.

File trees follow the same approach. Many frameworks require layers of nested components. Oink uses a fenced block that is close to plain text:

File tree source and rendered output

In Oink, it becomes a file tree with file icons, aligned comments, collapsible directories, and a draggable divider. Outside Oink, it remains immediately readable text.

Callouts use ordinary blockquotes, steps use ordinary lists, and field descriptions use ordinary tables. Images, code blocks, and data fences follow existing Markdown semantics wherever possible. Shortcodes are the fallback only when native Markdown cannot express a feature.

This is a practical engineering principle, not a matter of purity:

Frameworks age. Content should outlive them.

Second: Hugo, and nothing else

Oink uses Hugo Extended to compile templates and styles.

Normal builds don’t fetch fonts, JavaScript, or third-party assets from the network. Browser runtimes ship with the theme as well. The result is an ordinary public/ directory of static files.

hugo --gc --minify

Once the build finishes, you’re done.

You can put the output on:

  • GitHub Pages.
  • Cloudflare Pages.
  • Netlify.
  • Nginx.
  • Caddy.
  • Object storage.
  • An internal server.
  • An offline installation package.
  • Anything that can host static files.

No database, application server, always-online SaaS, search-service account, or Node runtime to keep running after deployment.

Image

This is what Oink means by local-first.

It means more than “you can open it on localhost.” You control the system’s essential capabilities:

  • The content lives in your Git repository.
  • The assets are in your build output.
  • The search index is part of your site.
  • Builds are reproducible.
  • The site works offline.
  • You can change hosting providers at any time.

Documentation, of all things, should work this way.

It shouldn’t turn into a collection of empty shells because a CDN, font service, hosted search provider, or frontend dependency stops working.

Third: one framework, six kinds of content

Real projects rarely have only “docs.”

As a project matures, it usually acquires:

  • A product homepage.
  • A blog and technical articles.
  • Release notes.
  • Packages and download pages.
  • An API reference.
  • Long-form books with chapters, figures, tables, and cross-references.

The traditional approach is to choose a separate tool for each, then try to make them look related.

Oink starts with a shared page shell, navigation, search, theming, and output system, then supports six kinds of content within it.

Documentation

A navigation tree on the left, an on-page outline on the right, breadcrumbs, previous/next links, edit and history links, full-text search, and keyboard navigation are all included.

ImageImage

Blogs

Blogs support author profiles, multi-author bylines, article series, tags, RSS, sharing controls, list/card/table indexes, and immersive pages with hero images for long-form reading.

ImageImage

Books

Books support chapter numbering, numbered figures and tables, equations, cross-references, tables of contents, and continuous printing of an entire book. Complex multilingual books such as DDIA are the main proving ground for this model.

ImageImage

Releases and downloads

A structured YAML file can generate release cards, download asset lists, checksums, and historical archives. Release information becomes data you can check and reuse, rather than fragments scattered through hand-written HTML.

Image

Landing pages

Oink includes server-rendered homepage sections that combine data and Markdown into product introductions, feature sections, metrics, pricing, FAQs, team profiles, and calls to action.

Both the Oink homepage you see today and the PGSTY company homepage use this landing-page system.

Image

API references

Swagger UI and Redoc ship as local runtimes. Keep the OpenAPI files in your repository, and the reference works offline or on a private network.

These six content types share one design language, search system, language switcher, version selector, set of output formats, and component system. Oink currently offers 21 kinds of technical content components, loading each runtime only on pages that use it.

That may sound like a way to configure fewer themes. The real benefit is larger:

One set of skills lets you maintain everything your project publishes.

Fourth: powerful features shouldn’t make every page heavier

Oink has plenty of advanced components:

Oink’s 21 technical content components

That doesn’t mean every page should load all their JavaScript.

A page without charts shouldn’t load ECharts. A page without Mermaid shouldn’t load Mermaid. A page without a terminal recording shouldn’t load its player. Component scripts are assembled according to what the page actually uses. Print, Markdown, and RSS outputs load none of these browser runtimes.

Oink calls this:

Content. On Demand.

Load the capability where it’s needed. Keep the overhead there, too.

Just as important, every component needs a useful form outside the browser.

In HTML, a file tree can be attractive and interactive. In print, it should expand in full. In Markdown, it should preserve the original fenced block. In RSS, it should at least fall back to readable source.

Graceful degradation is part of Oink’s content model, rather than an optional refinement.

A reliable documentation component has to work beyond the author’s current browser and theme version.

Fifth: design for people and agents

Oink’s support for AI agents goes deeper than adding a ChatGPT icon to the navigation bar.

It begins at the output layer.

The same Markdown content can generate:

  • HTML pages.
  • Print pages.
  • Raw Markdown pages.
  • RSS.
  • A site-wide llms.txt index.

Each HTML page declares the address of its Markdown counterpart. Agents and crawlers don’t have to strip away navigation, buttons, scripts, and styles, then guess which part is the article.

Crucially, this Markdown is not a reverse conversion from HTML. It preserves what you actually wrote as closely as possible. Components such as callouts, tables, file trees, and code fences each have a defined Markdown representation.

Image

An Oink site can therefore serve as an engineering knowledge base that agents can work with, beyond simply producing summaries of it.

You can ask an agent to:

  • Read the site structure.
  • Find a specific configuration setting.
  • Retrieve clean Markdown for the current page.
  • Extend the existing documentation.
  • Check Chinese and English translations.
  • Update release notes.
  • Edit source files directly in the repository.

I see this as a basic capability for future documentation frameworks, not an optional plugin.

The browser is one consumer of documentation. AI agents are becoming another.

Search, languages, and versions, already integrated

These features rarely get top billing on a documentation framework’s homepage, but in real projects they determine whether the system is usable.

Oink’s full-text search runs entirely locally. Hugo generates a JSON index for each language at build time; the browser downloads it and searches locally. No crawler, account, external CDN, or hosted service is required. Latin-script text uses Lunr, while CJK queries, including Chinese and Japanese, have a substring fallback. Search shouldn’t work in English while being useless in Chinese.

Search shares an interface with the command palette, opened with ⌘ K or Ctrl K. Alongside documentation, you can search page actions, language switches, and version switches.

Multilingual support uses Hugo’s native model, with translations alongside their source files. English, Simplified Chinese, and Traditional Chinese interface strings are fully maintained, and pages can have stable links to their translations.

Versioned documentation provides a version menu and notices for archived versions without dictating your deployment layout. Each version remains an independent, reproducible Hugo build, hosted on its own domain, subdomain, or path.

RSS, SEO, sitemaps, Google Analytics, Giscus comments, light and dark modes, print styles, image zoom, keyboard navigation, mobile layouts, and repository edit links are also included.

You could assemble all of this yourself.

I built Oink so you don’t have to do it again.

See fifteen production sites for yourself

Oink’s public showcase currently lists 15 real sites: large Chinese and English documentation sites, a company homepage, open-source projects, small tools, knowledge hubs, and three books. They range from a two-page site to distribution manuals with over a thousand content files.

If you’re starting a site, you don’t need to study every setting in an empty directory. Find an existing site close to what you need and use it as your starting point.

Image

These are production sites I use and maintain every day, rather than demos made for screenshots.

That matters.

Many of Oink’s design decisions came from specific problems encountered during real migrations. One survey informing the design documents covered 11 sites using the theme and more than 5,000 Markdown files. The public showcase extends that coverage from small tools to large distribution manuals.

The shared framework emerged from actual needs across those sites.

More than a screenshot and a README

It’s easy to build a Hugo theme with a nice-looking homepage, only for it to fall apart under complex content, mobile layouts, multiple languages, printing, or upgrades.

I won’t claim Oink is bug-free. But it has more behind it than a screenshot and a README.

Alongside validation on real sites, version 0.6 covers 40 golden-output cases across HTML, print, Markdown, RSS, and LLMS. It includes 85 migration tests, 38 browser runtime tests, bilingual site builds, large-site performance measurements, and browser checks of real Chinese and English pages.

Development previews and production releases also handle errors differently.

When ordinary hugo server encounters bad configuration, it tries to warn and fall back safely, so a typo doesn’t take down the entire preview. Production builds use --panicOnWarning: CI treats warnings strictly to keep broken output from being published.

The approach owes something to database systems:

  • Provide as much diagnostic information as possible during development.
  • Enforce strict checks before production releases.
  • Don’t let errors silently produce misleading results.
  • Don’t let a local input error take every page down with it.

It may be called Oink, but there is an engineer’s sensibility underneath.

Getting started doesn’t require learning Oink first

To be honest, these days I don’t write all this documentation expecting people to read every page themselves.

The simplest way to get started is to hand the task to Codex or Claude Code.

Oink’s documentation site doubles as a complete example and regression test site, covering every page type and component. The recommended fast path is to clone it, remove what you don’t need, and replace the rest with your own content.

For a human, it takes a few commands:

git clone https://github.com/pgsty/oink.pgsty.com my-docs
cd my-docs
hugo server

Then change the site name, domain, and repository URL, and replace content/ with your own material.

You don’t even have to do that yourself.

You can give an agent the following prompt:

Starter prompt in the original Chinese

English transcription of the prompt above:

Use the Oink Hugo theme to create a modern documentation site for my project.

Refer to the Quick Start at oink.pgsty.com and the showcase site closest to my requirements.

Project name: [name]
Project domain: [domain]
Code repository: [repository URL]

Requirements:

  1. Organize content in plain Markdown. Do not introduce Node.js, MDX, or an additional frontend toolchain.
  2. Build with Hugo Extended and provide a local preview with hugo server.
  3. Enable local full-text search, Markdown page output, and llms.txt.
  4. Configure documentation, a blog, books, landing pages, releases and downloads, or an API reference as appropriate for the project.
  5. Set up automated deployment to GitHub Pages or Cloudflare Pages.
  6. Run the strict production build and fix every warning.
  7. Unless the project name, domain, or repository URL is missing, complete the work without stopping to ask questions.

You have two responsibilities:

First, tell the agent what kind of site you want.

Second, write content worth reading.

Theme configuration, directory organization, build scripts, and deployment details are work for the tools. Documentation authors shouldn’t each have to learn them all over again.

Who is Oink for?

Oink is a particularly good fit for a few groups.

Open-source project authors

You’ve built the project. You want a decent homepage, documentation, blog, and release pages quickly, without spending another few days learning a frontend framework.

Infrastructure and engineering software teams

Databases, operations platforms, middleware, developer tools, distributions, and self-hosted software need plenty of configuration references, commands, architecture diagrams, file trees, terminal recordings, and versioned documentation. Oink’s components and local-first delivery model are designed for this kind of content.

Teams that need private networks, offline access, or long-term archives

When documentation must work on a private network, in a customer’s environment, in an offline installer, or in an isolated environment, avoiding external CDNs, search services, and runtime backends removes a lot of friction.

Book authors, translators, and maintainers of large knowledge bases

Chapter numbering, cross-references, figures, tables, equations, multiple languages, whole-book printing, and stable anchors all become real concerns in long-form content.

People maintaining several projects

With five, ten, or more projects, the benefits of a shared framework add up quickly. You no longer have to remember each site’s theme, component dialect, and deployment method.

My own migration of 18 sites is a straightforward example.

Who is Oink not for?

Oink isn’t a universal framework, and it doesn’t need to pretend to be one.

If you need:

  • A drag-and-drop WYSIWYG CMS.
  • An online collaborative editing backend.
  • A complex user account and permissions system.
  • Extensive dynamic application state.
  • A frontend platform for embedding arbitrary React applications.
  • A web application dependent on real-time server-side computation.

Then Oink is the wrong choice.

Its scope is clear: build modern, reliable, static content sites from Markdown and structured data.

That boundary is what keeps it simple.

Documentation should be the last thing to break

I’ve spent a lot of time wrestling with documentation over the past few years.

I’ve used Docsy, hosted books with Hextra, blogged with Blowfish, and tried various frontend frameworks. Each has its strengths. But as the sites multiplied and the content grew more complex, I came back to a simple approach:

  • Write content in Markdown.
  • Build with a single binary.
  • Output ordinary static files.
  • Ship as many assets locally as possible.
  • Keep presentation and content separate wherever possible.
  • Give people and agents the same source of truth.

New technology has its place. But a fashionable stack isn’t what matters most for documentation.

What matters is:

  • Can you still open it ten years from now?
  • Can you deploy it on another platform?
  • Does it work offline?
  • Can people and machines still understand it?
  • Can you maintain it as the project grows?

Documentation should be the easiest part of a project to deploy and the hardest to break.

Oink is an attempt to make that true again.

Oink is open source under Apache 2.0. It preserves Docsy’s history and upstream attribution, and records the license of each third-party runtime distributed with the theme.

It is far from finished. But it is good enough for me to entrust all eighteen of my websites to it.

As long as those sites exist, I’ll keep maintaining it.

You don’t need to learn a pile of concepts or start with an empty directory.

Find the showcase site closest to what you need, copy it, replace the content, and let an agent handle the remaining details.

Feed it Markdown. Let the pig do the rest.

Oink’s pig mascot writing in a library
  • Oink documentation and showcase[1]
  • Oink GitHub repository[2]
  • Oink documentation site source[3]

References

Follow along for more from a database veteran. ⭐️


Published on WeChat.

4 - Immersive reading on the Blog shell

Four front matter keys turn an ordinary Blog page into a reading-first layout with a full-bleed hero and an in-flow outline rail.

This page is rendered by the ordinary Blog shell. There is no special content type behind it. Four front matter keys change the presentation, and a section can set the same recipe once in a cascade:

featured_image: hero      # the image becomes a full-bleed opening
toc_style: flow           # a wider outline starts with the article
toc_taxonomies: false     # the rail carries the outline alone
sidebar_enabled: false

The hero

A page with a featured image can open with it. hero turns that image into a full-bleed backdrop across the top of the viewport, moves the title down to give it room, and masks the artwork away before the body begins. Because the shell paints it, the same presentation also works on a section index.

The page card, social preview, and Hero all use the same representative-image resolver. featured_image: banner keeps the framed alternative, while a page without a suitable image simply falls back to the normal opening.

The outline rail

toc_style: flow replaces the viewport-pinned outline with a wider rail in the content flow. It starts beside the article below the Hero and becomes sticky only after scrolling. The switch is independent of the image, so one section can keep a consistent outline even when some pages have no artwork.

toc_taxonomies: false removes the taxonomy clouds. If a page has neither an outline nor clouds, the empty rail is omitted completely.

What remains available

Everything below the opening is still a normal Blog article: date and reading time, tag badges, authors and profiles, the series strip, the description lead, sharing, annotation, sequential navigation, and comments. The Blog shell omits breadcrumbs by default; breadcrumb: true restores one for a page that needs its position in the tree to remain visible.

5 - Oink: After Six Years of Wrestling with Documentation Frameworks, Codex Finally Got Me Over the Line

After six years of trying eight approaches, I used Codex to combine Docsy’s engineering depth, Fumadocs’ modern UX, and Hugo’s simple delivery model into Oink.

Building a documentation site is not hard. The hard part is keeping it useful five years later.

At first, you only want to put a few Markdown files online.

Then the requirements start growing on their own: full-text search, dark mode, multiple languages, multiple versions, API documentation, flowcharts, terminal recordings, mobile support, SEO, RSS, comments, analytics, print output…

By the time you look up again, you are maintaining a frontend project: Node.js, npm, PostCSS, dozens of dependencies, and a pile of CDN links that could stop working at any moment.

Documentation is supposed to reduce a project’s maintenance cost. Instead, it becomes yet another project to maintain.

That is why I built Oink.

OINK Chinese documentation homepageOINK project homepageOINK blog

1. Six Years, Eight Approaches, Not One I Liked

I have spent more than my share of time on documentation frameworks. Documentation is the storefront of an open-source project: users often see the docs before they download the software. You can argue that appearances do not matter, but you cannot let the storefront look bad.

The list of options I tried reads like an archaeological record:

  • Docsy: the most comprehensive option, a theme framework built on Hugo by Google. Many well-known cloud-native projects use it; it is practically the standard choice for CNCF projects. I used it five or six years ago when I first built Pigsty’s documentation site.
  • Docsify: pure JavaScript plus Markdown, so lightweight that there is almost no build step. The tradeoff is weaker SEO and a worse initial load.
  • Docusaurus: the standard choice in the React ecosystem, with a complete feature set. You also inherit an entire Node.js project.
  • Hugo + Hextra: fast, simple, and fine for a small site, but it falls short for a large engineering documentation project.
  • Documentation SaaS products such as Mintlify: polished, well designed, and convenient—but hardly cheap. Your documentation also lives in someone else’s hands, with no option for offline delivery.
  • Next.js + Fumadocs: excellent frontend polish, close to Mintlify. But full-text search is slow, builds are slow, content uses MDX rather than plain Markdown, producing a purely static site takes considerable effort, and the whole thing depends on a large Node.js and Next.js stack.
Pigsty documentation built with Fumadocs

I tried plenty of other options too: Jekyll in Ruby, Sphinx and Pelican in Python, and even a homegrown version built with Editor.js. Many had distinctive strengths, but none truly satisfied me. I went around in circles and burned a great deal of time with little to show for it.

After several laps, I ended up back where I started: Docsy. It has the most complete feature set—navigation, editing, printing, blogs, multiple languages and versions, SEO, full-text search, and offline delivery.

But it also has two drawbacks: it is ugly, and it has far too many dependencies.

The old Pigsty documentation site built with Docsy

To support all those features on Hugo, Docsy bolts on an entire frontend toolchain: npm, the whole node_modules universe, PostCSS to preprocess SCSS, and Autoprefixer. Hugo’s original appeal is that one binary is all you need. Add this stack, and building, previewing, and maintaining the site all become more complicated.

You cannot even have Cloudflare Pages build the site automatically. You have to complete the build in GitHub Actions first—all for a static documentation site.

That left me in an awkward position: the best-looking options were missing important pieces, while the most capable one was ugly and cumbersome.

So why not write my own?

Because I genuinely did not have the time. Frontend work devours time and energy, and it has little to do with my day job. I am a database veteran, not a frontend engineer. Wrestling with CSS and JavaScript for a documentation theme never made economic sense. I ran the numbers for six years; they never worked.

2. Until Frontend Delivery Became an On-Demand Commodity

Starting last month, the math suddenly changed.

Top-tier frontend design and implementation became a general-purpose commodity, metered by the token. I no longer need to become a frontend engineer. I only need to know exactly what I want—and after six years of thinking about it, I do.

For the first time, I could almost wish it into existence:

Give me Docsy’s complete feature set, graft on the frontend polish of Fumadocs and Nextra, add the capabilities engineering documentation actually needs, and throw out the mess of dependencies—a clean Hugo Extended binary should be all it takes to build and run the site.

To be honest, I built this with help from Codex and other AI tools. But this was not vibe coding for a throwaway side project: AI did not invent the need. The need had been sitting there for six years. What AI did was dramatically lower the threshold at which the project became worth doing.

A few days ago, someone asked what I had to show for seven AI subscriptions and all the tokens they burn every day.

This is one result. The entire framework, plus six or seven documentation sites, took only two or three days from start to finish. In fact, I had so many bigger jobs on my plate that I never found time to write this article until now.

3. Why OINK?

OINK is, of course, the sound a pig makes.

My main open-source project is called Pigsty—a pigsty. The components that have grown around it over the past two years all have pig-related names:

  • Pig — the package manager, a piglet;
  • Sow — the repository manager, both a female pig and a verb meaning to plant seeds;
  • Boar — the graphical management platform, a wild pig;
  • Silo — object storage, the grain silo on a farm.

The pigsty already had three pigs. I could hardly drag in another for the documentation project, so I let the existing pigs oink instead: OINK is how their content gets out.

There is another pun inside the name: OINK contains ink, which suits a documentation project nicely.

For a more serious explanation, the four letters even make a respectable acronym:

Open · Indexed · Navigable · Knowledge

Open, indexed, navigable knowledge.

OINK tools and components

4. What I Cut: Downstream Sites Need Only Hugo

OINK’s most important design decision was to shrink the build boundary for downstream sites to Hugo Extended.

A production build takes one command:

hugo

No npm install, no PostCSS, no node_modules, and no need to fetch runtimes from public CDNs during the build.

Bootstrap, Font Awesome, fonts, Lunr search, Mermaid, KaTeX, Markmap, Swagger UI, Redoc, Asciinema, ECharts, and AntV Infographic all ship locally with the theme source.

The benefits are straightforward: reproducible builds, an auditable supply chain, and easy deployment to intranets and network-isolated environments. When I distribute offline documentation, it must remain readable and searchable without an internet connection. For me, that is a requirement, not a bonus.

Once you have the complete theme, Hugo compiles the content, configuration, layouts, and assets into a public/ directory in one pass. You can then host it on object storage, GitHub Pages, Cloudflare Pages, Nginx, or an internal file server. The hosting layer does not need to know what OINK is.

5. What I Added: A Modern Documentation Shell

Traditional Hugo themes often feel usable but a decade out of date. OINK keeps Hugo’s simple delivery model while adding what a modern documentation product should provide:

  • Global navigation, breadcrumbs, and a collapsible, resizable sidebar;
  • An in-page table of contents, reading metadata, previous and next navigation, and edit and feedback links;
  • Light and dark modes, a version selector, print view, and a mobile action panel;
  • RSS, SEO, canonical URLs, hreflang, and Open Graph metadata;
  • Local full-text search (⌘K), plus optional Algolia and Google-hosted search;
  • Blogs, categories, tags, comments, featured images, and multilingual information architecture.

With OINK 0.2.0, the homepage is no longer an HTML template that must be copied before it can be changed. It provides 12 composable sections: Hero, metrics, feature narratives, principles, cards, a logo wall, gallery, testimonials, contributors, FAQ, free-form Markdown, and CTA. A site can rearrange, reuse, or remove homepage modules simply by declaring their order and content in data/home/<language>.yaml.

This boundary matters: configuration should express what a site wants, not expose how the theme assembles it internally.

One optimization deserves a special mention. Once a site grows large, its full-text search index can reach tens of megabytes. One of my sites used to transfer more than 800 GB a month, and the index accounted for more than half of it. The homepage no longer downloads it; the index is first loaded only when a user actually opens search. The bandwidth bill and the user experience, for once, improve in the same direction.

Building an OINK bilingual site with Hugo

6. Engineering Content Should Not Be Reduced to Screenshots

Engineering documentation contains more than prose and code blocks.

A database or infrastructure project often needs terminal demos, architecture and sequence diagrams, performance charts, mathematical formulas, API references, infographics, and interactive parameter guides. These capabilities used to be scattered among site-specific shortcodes, then copied and tweaked for each new project.

OINK turns the components that have proved broadly useful into stable authoring interfaces:

  • Asciinema terminal recordings;
OINK’s Asciinema terminal recording component
  • Apache ECharts data visualizations and AntV Infographic diagrams;
  • Mermaid, KaTeX, Markmap, PlantUML, and Diagrams.net;
  • Swagger UI and Redoc API documentation;
  • Steps, tabs, collapsible blocks, cards, card groups, and documentation carousels;
  • The existing Docsy shortcodes: alert, include, readfile, image, and blocks.

The comment system also lets readers sign in with a GitHub account.

Comments with GitHub sign-in

The key point is that OINK does not stuff an entire frontend runtime into every page. When a shortcode renders, it records its presence in Hugo’s page state, and the asset assembly stage checks that marker. Only pages that use ECharts load ECharts, and ten charts on one page still load it only once. A prose-only article does not load every runtime merely because the theme “supports many features.”

That is also what I mean by “feature-rich”: authors can reach for any capability when they need it, while readers pay the download cost only for what the current page actually uses.

OINK documentation navigation on mobile

7. Multilingual Does Not Mean Copying a /zh Directory

OINK builds its language model directly on Hugo’s multilingual page objects. It does not guess the language from a domain name or a hard-coded URL.

With only one language, the language selector hides itself. With two or more, the button switches according to the configured language weights, while the full menu lists every language. If the current page has no translation in the target language, the link falls back to that language’s homepage instead of inventing a plausible-looking URL that returns a 404.

Each language gets an independent local search index, so English results do not leak into Chinese searches. HTML lang, text direction, canonical, hreflang, and Open Graph locale values all come from the same set of translation objects. This prevents the interface from switching to Chinese while the SEO metadata still claims the page is English.

OINK Chinese full-text search

8. Eating My Own Dog Food

There is a cardinal sin in building a documentation framework: spending all your time on the scaffolding, only to have no content to put inside it. The real test is whether you use it yourself.

So I quickly moved all my sites onto OINK:

  • pigsty.io / pigsty.cc — the English and Chinese sites for Pigsty, a PostgreSQL distribution, and currently the largest use case.
Pigsty Chinese documentation built with OINK
  • silo.pgsty.com — the newly released Silo, a community fork of MinIO.
Silo project site built with OINK
  • pig.pgsty.com — the PostgreSQL package manager for installing extensions.
Pig project site built with OINK
  • sow.pgsty.com — the APT / DNF repository manager, naturally paired with Pig.
Sow project site built with OINK
  • exp.pgsty.com — PG Exporter, a project I built long ago that finally has a site of its own.
PG Exporter project site built with OINK
  • pgsty.com — the homepage for the GitHub organization and company.
The PGSTY homepage built with OINK
  • oink.pgsty.com — OINK’s own documentation site, naturally built with its own theme.
Features on the OINK project site

OINK was designed for open-source projects and engineering documentation, but it works elsewhere too. The books I have translated—six or seven of them—are now gradually moving to the same framework.

A book site built with OINKA data systems book site built with OINK

9. Get Started in Three Minutes

OINK 0.2.0 requires Git, Go, and Hugo Extended 0.160.1 or later. The current project site has been validated with Hugo Extended 0.164.0.

Initialize a module and pin the version from the root of your Hugo site:

hugo mod init github.com/example/product-docs
hugo mod get github.com/pgsty/oink@v0.2.0

Import the theme in hugo.yaml:

module:
  imports:
    - path: github.com/pgsty/oink

Then start the preview server:

hugo server

For a complete bilingual site structure, configuration, and deployment setup, see the OINK getting-started guide. If you want to see it in action first, browse the OINK project site. The theme source is in pgsty/oink, while the complete project site and its tests are in pgsty/oink.pgsty.com.

If you already have a Docsy site, you can migrate directly—in theory, any Docsy site can move over. With so many example sites above, you can download any one of them, adapt it, and get started.

10. Who Is OINK For—and Not For?

A good fit: you maintain an open-source project, database, infrastructure system, internal platform, or another engineering product meant to evolve over the long term; you need multiple languages, offline delivery, auditable dependencies, rich technical content, and reliable static deployment.

Not a good fit: you need a CMS for multi-user online collaboration, dynamic content behind user accounts, a real-time data backend, or a complete frontend application framework. OINK is a Hugo theme, not a SaaS product or application server, and it does not try to disguise a static documentation site as a universal platform.

I like Hugo precisely because it is boring enough: one binary, one content tree, one build command, and a static artifact you can put anywhere. OINK is not trying to repackage that simplicity inside a complex framework. It aims to squeeze everything modern engineering documentation genuinely needs back into that simple path.

A good documentation framework should never make authors feel it running every day.

It should simply make content easier to write, answers easier to find, and knowledge still buildable, readable, and portable years from now.

That is OINK.

6 - Introducing the OINK implementation preview

OINK turns a directly customized Docsy codebase into a local-first, Hugo-only documentation theme with multilingual infrastructure and reusable content components.

Today we are publishing the OINK implementation preview: a directly evolved Docsy theme with one canonical product shell, a Hugo-only consumer build, local-first browser dependencies, a general multilingual framework, and a set of reusable content components drawn from PGSTY documentation sites.

This preview marks the implementation and documentation milestone ahead of the first tagged release and production Cloudflare Pages deployment.

Why OINK exists

Several mature documentation sites had independently copied the same Docsy layouts, navigation, search code, SCSS, JavaScript, and shortcodes. A common fix had to be repeated across repositories, while each site also carried a frontend toolchain and implicit network dependencies that made isolated builds harder than they needed to be.

OINK consolidates the genuinely reusable layer. Product matrices, portals, pricing pages, and other business-specific behavior stay in their own sites. The shared theme owns the documentation shell, browser runtimes, multilingual routing, accessibility behavior, and content-component contracts.

What changes

One product instead of a mode

OINK is not an optional skin. There is no oink.enabled flag, params.oink.* namespace, or parallel upstream-versus-brand template tree. The implementation in theme/ is the product.

That decision avoids two visual systems and two test matrices. Native Hugo settings and compatible Docsy parameters keep their established meanings.

Hugo-only consumer builds

A complete consuming site builds with:

hugo --gc --minify

Bootstrap, Font Awesome, fonts, search, diagrams, API documentation runtimes, and OINK components are committed with the theme. Node.js, npm, PostCSS, Autoprefixer, and CDN downloads are not consumer requirements.

Repository maintainers still use Node-based tools for tests and vendor refreshes. That maintenance toolchain is deliberately outside the public site-build contract.

Local-first browser behavior

The default starter serves its shell, fonts, icons, search, Mermaid, KaTeX, Markmap, Swagger UI, Redoc, Asciinema, ECharts, and Infographic dependencies from the generated site. Optional runtimes are selected per page and loaded at most once.

PlantUML and Diagrams.net do not receive public service defaults. A site must configure a controlled endpoint, use a pre-rendered result, or make an explicit remote-service choice.

Multilingual infrastructure

Language routing comes from Hugo’s language and translation objects. One configured language hides the selector. With two or more languages, a click advances by configured weight, while a short hover or keyboard focus opens the complete menu. If the current page lacks a translation, the selector goes to the target-language home page instead of a dead path.

The starter and documentation site use English as the primary language and Simplified Chinese as the second. Every page in the core docs and blog scope has a colocated .zh.md translation with stable explicit heading IDs.

Reusable components

OINK adds theme-owned Asciinema, ECharts, Infographic, document carousel, details, tabs, cards, navigation cards, document cards, and parameter components. They generate unique instance IDs and load their local assets only when used.

ECharts accepts structured JSON or YAML plus optional JavaScript callbacks referenced as $fn:name. Callback code runs only on pages that declare it.

What stays familiar

OINK retains Docsy’s content organization, front matter, documentation and blog sections, menus, taxonomies, print output, repository links, common shortcodes, diagrams, API reference features, and extension hooks. Existing sites can remove duplicated common implementations without rewriting ordinary Markdown.

The project also preserves Docsy’s Apache-2.0 history and attribution. A vendor manifest records pinned third-party sources, licenses, artifacts, and checksums.

Try the starter

Historical preview post

This article records OINK’s original implementation preview. Current releases use plain CSS and are tested on Hugo 0.170+ (no Sass compiler needed); follow Get started for up-to-date setup instructions.

Install Git, Go, and Hugo per Get started, then evaluate the official Starter:

git clone https://github.com/pgsty/oink-starter.git my-docs
cd my-docs
hugo server

Update older Starter workflow pins to the same Hugo baseline. Open the local English and Chinese pages, switch languages, search locally, change color mode, and visit the component examples. For an isolated environment, follow the offline archive installation guide.

Current validation

The implementation includes automated coverage for:

  • Hugo Extended 0.168.0 builds;
  • forbidden consumer Node/npm/PostCSS/Autoprefixer paths;
  • LTR, RTL, subpath, print, color-mode, and production assets;
  • hidden, click-to-cycle, hover-menu, translation-fallback, and RTL language behavior;
  • local per-page runtimes and repeated component instances;
  • ECharts structured options and callback integration;
  • an offline bilingual starter and offline release archive;
  • vendor licenses and checksums;
  • non-mutating migration rehearsals for SILO, PGSTY, SOW, and Pigsty.

The latest four-site rehearsal built temporary copies of all four sites cleanly.

What remains before release

Before tagging the first public release, we will finalize the module and package identities, apply the initial version across source tags, archives, and documentation, and connect the production Cloudflare Pages deployment to the pinned Hugo baseline.

7 - OINK implementation diary: from copied shells to one theme

A technical diary of the decisions, migrations, safety boundaries, tests, and documentation work behind the OINK implementation preview.

OINK began with an awkward observation: several production documentation sites looked related because they were related, but their common implementation lived as copied files. The visible result was consistent enough; the maintenance model was not.

This diary records the engineering decisions, migrations, and test constraints that turned those scattered site overrides into a single theme.

Locking the contract

The first useful work was subtraction. We wrote down what the product must be before choosing how to implement it:

  • an independent theme derived directly from Docsy;
  • one canonical shell, not a switchable skin;
  • Hugo Extended as the only consumer build dependency;
  • local-first delivery for every theme-owned browser asset;
  • multilingual behavior derived from Hugo rather than PGSTY domains;
  • reusable components in the theme, business semantics in the site;
  • preserved Docsy history, licenses, and upstream traceability.

This ruled out an attractive but costly shortcut: adding params.oink.enabled and leaving the old shell in place. A mode switch would have made every layout change, accessibility fix, and test support two products. Direct evolution made the intended design the only design.

Replacing the shell

The documentation, blog, and API-reference layouts were rebuilt around shared, small partials. The resulting shell includes:

  • global navigation and responsive sub-navigation;
  • a resizable, foldable sidebar;
  • local search and quick links;
  • language and color-mode controls;
  • breadcrumbs, table of contents, page metadata, and feedback;
  • a consistent footer and print layout.

The hard part was not drawing a navbar. It was preserving existing Docsy extension points while removing copied baseof.html files. Narrow hooks remain; site-wide shell duplication no longer has to be the normal customization path.

Removing the consumer toolchain

The original dependency chain assumed npm-provided Bootstrap and Font Awesome, and some paths invoked PostCSS. OINK moved the required sources and compiled artifacts into the theme and kept SCSS inside Hugo’s own asset pipeline.

Tests do more than check that hugo succeeds. Fixture traps fail if a consumer build tries to run Node.js, npm, PostCSS, or Autoprefixer, or if a template uses resources.GetRemote. LTR and RTL pages go through the same constraint.

This distinction matters: the repository still uses Node for its maintainer test harness. “Hugo-only” describes what a consuming site needs after it has a complete theme, not a ban on development tooling inside the theme repository.

Vendoring browser runtimes

The next layer was every dependency the browser might otherwise fetch: Bootstrap, Font Awesome, fonts, jQuery, Lunr, Mermaid, KaTeX, Markmap, Swagger UI, Redoc, Asciinema, ECharts, Infographic, and their supporting libraries.

Each selected artifact received a source, fixed version, license path, checksum, and update procedure in theme/VENDOR.json. Licenses live beside the vendored material. The manifest is validated against the actual files rather than treated as an aspirational inventory.

PlantUML and Diagrams.net forced a useful distinction. They are service-backed features, not merely JavaScript libraries. OINK refuses to invent a public endpoint: enabling one without a configured service fails the build.

Building the multilingual core

The previous language behavior was scattered across navigation and site-specific assumptions. The new core starts with Hugo’s configured languages, .Translations, and .AllTranslations.

The presentation is deliberately stable: one language hides the selector; two or more use the same icon button. Clicking advances by configured weight, while a short hover or keyboard focus opens the complete language menu.

A missing translation falls back to the target-language home page. Language labels use each language’s own name. The same objects drive lang, direction, canonical, hreflang, and Open Graph locale metadata, so the visible selector cannot drift from SEO output.

The tests construct every state with an RTL current language as well as normal LTR cases. Native links and disclosure controls keep keyboard behavior predictable.

Promoting components

Asciinema, ECharts, Infographic, document carousel, details, tabs, cards, and parameter rendering had already proved valuable in PGSTY sites. The work was to turn them from copies into product APIs:

  • normalize parameter names and defaults;
  • generate unique IDs from page identity and shortcode ordinal;
  • load each runtime once per page and omit it from unused pages;
  • preserve subpath URLs;
  • support repeated identical instances;
  • provide print, dark-mode, mobile, keyboard, and reduced-motion behavior;
  • retain compatible aliases for imported content.

Product matrices and other business widgets did not move. Reuse is not measured by the number of repositories containing a copy; it requires a stable, business-neutral contract.

Supporting ECharts callbacks

ECharts callbacks are legitimate chart options that JSON and YAML cannot express. Existing pages use them for tooltip formatting, label formatting, and data-dependent colors. Treating those callbacks as a separate migration exception added configuration without creating a sandbox.

The shortcode therefore keeps one direct contract:

  1. content supplies JSON or YAML, which Hugo parses and safely serializes;
  2. an optional fenced JavaScript block declares callbacks;
  3. $fn:name values reconnect those callbacks after the options are parsed;
  4. authors review executable code under the same trust model as inline HTML and other custom integrations.

Tests cover repeated identical charts, invalid CSS lengths, structured options, and callback registration.

Creating the starter and archive

A contract is easier to trust when the smallest example demonstrates it. The starter contains bilingual home, docs, blog, and component pages; local search; dark mode; diagrams; API documentation; and the new components. It has no package.json and no site workflow.

The offline packager combines theme/, starter/, licenses, the upstream record, and migration guidance, excluding generated output and dependency caches. It writes a sidecar SHA-256 file and refuses to overwrite an existing artifact.

The acceptance test copies the starter and theme to a temporary directory, empties caches, blocks HTTP/HTTPS and Go proxies, builds with Hugo, and examines HTML and CSS for third-party subresources.

Rehearsing four migrations

SILO, PGSTY, SOW, and Pigsty provided the reality check. The rehearsal tool copies each workspace instead of modifying it, removes only classified common overrides, applies a local theme replacement, forbids network and frontend tools, and runs the production build.

The latest rehearsal removed 20 common overrides from SILO, PGSTY, and SOW and 24 from Pigsty. Pigsty retained its three business matrix shortcodes and existing ECharts callbacks. All temporary copies built cleanly, producing 1,095, 16, 128, and 2,473 HTML files respectively.

Turning the sample into OINK docs

The inherited docsy.dev site was valuable as a regression corpus, but it described only Docsy. The documentation phase did four things:

  1. made English primary and Simplified Chinese second; a later shell review removed French from the demonstration site;
  2. translated every core documentation and blog source into a colocated .zh.md page;
  3. preserved English heading IDs explicitly in every Chinese heading;
  4. added the OINK product guide, announcement, and this implementation diary.

Before translation, we established a terminology and typography guide. A checker then verifies source/translation pairs, heading counts, explicit Chinese IDs, and rendered English/Chinese heading-ID equality.

Historical Docsy release posts remain faithful translations. Their npm-era instructions are historical context, while the OINK architecture and migration guides state the current Hugo-only product contract.

What testing changed

Several tests changed the design rather than merely blessing it:

  • subpath fixtures forced every local component URL through Hugo URL handling;
  • repeated-instance tests replaced content hashes with page-and-ordinal IDs;
  • offline browser checks exposed implicit runtime requests;
  • RTL language matrices prevented a selector implementation that only worked for the starter’s two LTR languages;
  • ECharts callback fixtures kept callback registration and structured options interoperable;
  • migration rehearsals preserved site-specific partials that a blanket layouts/ deletion would have removed.

Remaining work

Before the first tagged release, we will finalize the public repository, module and package identities, and connect the Cloudflare Pages project to build from the source branch.

Production migrations will proceed one site at a time on dedicated branches, with preview deployments, visual regression checks, and rollback artifacts.

Lessons

  • Write the product boundary before moving files.
  • Verify local-first delivery at both build time and browser runtime.
  • Keep configuration focused on user choices rather than internal implementation branches.
  • Check stable links, code fidelity, typography, and rendered structure alongside translated prose.
  • Consolidate shared mechanics in the theme while keeping business-specific widgets in their sites.

The result is one theme that can be built, tested, translated, and upgraded as a coherent product.