There are moments in every codebase where you can feel the weight of your own ideas. You build a blog. It works. You add notes for the small thoughts. It works. Then you find yourself pasting the same tiny code sample into a note, then again into a post, and suddenly the distinction between those two formats starts to blur.

I hit that wall while writing down a few lines of Zig that I wanted to keep around. It wasn’t a post. It wasn’t a note either. It was a snapshot. A small, complete idea. Something you want to keep, not explain.

That is where snippets come from.

A Small Thing, Done Properly

Snippets are short, timestamped code samples stored in content/snippets/. Each snippet has a description and an optional display filename. The filename matters because it tells the renderer which syntax highlighting class to use. This mirrors how tools like GitHub Gists do it, without any extra metadata or complexity.

A snippet file looks like this:

+++
description = "Print Hello"
filename = "hello.zig"
+++

Below that frontmatter, you put the code. That is all.

No titles to invent. No long-form structure to maintain. No Markdown rendering pipeline. The code is the content, and the frontmatter is just enough context to make it useful.

Why Timestamps

Gesttalt is strict about how content is organized. It’s a feature, not a limitation. The timestamp-based filenames for snippets are the same decision we made for notes: predictable IDs, correct ordering, and no slug collisions. You can create a snippet anywhere, on any machine, without asking the system what the next available slug might be.

The display filename gives you a human-friendly label while keeping the storage convention simple. The storage path stays stable, and the display name stays readable. Both are important.

The Rendering Is Deliberate

Snippets render to a plain <pre><code> block with a language-{ext} class. That class is a convention, not a dependency. Prism, Highlight.js, and other libraries all understand it, but Gesttalt doesn’t force any of them on you. Themes stay in control of presentation.

This is the Gesttalt philosophy in miniature: predictable output, no hidden dependencies, and a clean handoff to the theme layer.

A New Feed for a New Format

Snippets have their own feed at /snippets.xml, and they are also part of the combined /all.xml feed. The feed title uses the snippet description, and the description uses the first slice of the code. It’s just enough to be useful in a reader without pretending to be something it isn’t.

This keeps snippets visible without turning them into blog posts. They exist alongside the rest of the content, not inside it.

What This Enables

Snippets are a small feature that unlocks a different kind of publishing. They are for the things you want to keep and share without explanation: a regex you finally got right, a four-line shell command, a Zig type definition you’ll want again in six months.

It’s the little pieces of work that rarely deserve an essay but always deserve a home.

If your theme includes theme/layouts/snippets/, you already have that home. If it doesn’t, nothing breaks. Your existing sites remain stable, and snippets remain optional.

That is how it should be.