colophon

module
v0.0.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: Apache-2.0

README

colophon

Write it once. Own it forever. Publish anywhere.

A static site generator for bloggers — a simple CLI that turns a folder of Markdown (or any other supported source, such as an Obsidian vault) into a fast, themed blog. Built on a principle of freedom: own your words, host them anywhere (Cloudflare Pages, an S3/R2 bucket, a git branch, or any command), and federate them (RSS/Atom/JSON feeds, IndieWeb microformats) so your writing is never tied to a platform.

Features

  • Markdown in, static site outmd-dir and Obsidian-vault sources; code highlighting, maths (KaTeX), diagrams (Mermaid), callouts, wikilinks, embeds, series, tags and a glossary.
  • Themes — embedded press (with broadsheet/gazette variants), default and minimal, plus community themes in contrib/themes/; per-environment overrides; progressive enhancement, so every theme works with JavaScript off.
  • Static search — a fully static, sharded index (no server, no third party) with a tiny browser reader and optional fuzzy matching. A reusable module under search/.
  • Rich media — embed video/audio with plain image syntax (![](demo.mp4) → a player) and attach downloadable files (scripts, datasets, PDFs) to a post — copied/routed like images.
  • AI media generation (opt-in) — generate images from a gen:<prompt> reference and spoken (TTS) audio readings of posts, via configured providers (Google, OpenAI-compatible, MiniMax). Results are content-addressed and cached; secrets stay in the environment.
  • Feeds & SEO — RSS, Atom and JSON feeds (podcast-style enclosures for audio/attachments); canonical / Open Graph / Twitter / JSON-LD metadata; sitemap and robots.
  • Authors & personas — a shown author (byline + h-card, Gravatar supported) vs a hidden persona (a reusable writing voice); persona context emits write-as context for an AI.
  • AI authoring skills — optional Claude Code / opencode skills that drive colophon to write, edit, cross-link and publish — the engine supplies the voice, never an LLM or your secrets.
  • Pluggable publishers — Cloudflare Pages, Cloudflare R2 / S3 (SigV4), local mirror, git branch, or any command. Incremental: only changed files upload, orphans are pruned.

Install

Download a prebuilt binary — grab the archive for your OS/arch from the Releases page, extract it, and put colophon on your PATH:

# example: Linux x86-64 (swap in your platform's asset name)
curl -sSL https://github.com/jmylchreest/colophon/releases/latest/download/colophon_VERSION_linux_amd64.tar.gz | tar -xz
sudo mv colophon /usr/local/bin/

Prebuilt for Linux, macOS and Windows on amd64/arm64; each release lists checksums.txt.

Or with Go (1.26+): go install github.com/jmylchreest/colophon/cmd/colophon@latest, or build from a clone — git clone … && cd colophon && go build -o colophon ./cmd/colophon.

Quick start

colophon init mysite && cd mysite
colophon new post "Hello World"   # scaffold a post in content/
colophon serve                    # preview at http://localhost:8080 with live reload
colophon build                    # render the static site to ./public

colophon init writes an annotated colophon.yaml. Run colophon <command> --help for any of: init, new, build, serve, publish, themes, authors, persona, sources, posts, search, doctor, env.

Configure & publish

A minimal colophon.yaml — a site, a theme, a feed, and where to deploy:

sites:
  - id: main
    title: "My Site"
    base_url: "https://example.com"
    theme: press
    search: lexical
    federation:
      feeds: [rss, atom, json]

publishers:
  - id: cf
    driver: cloudflare-pages
    project: my-site
    account_id: "{env:CLOUDFLARE_ACCOUNT_ID}"   # non-secrets can interpolate the environment

environments:
  - name: production
    publish: [cf]
    allow_publish: false        # safety latch — deploying requires --allow-publish

Deploy credentials are never written in config — they're read from the environment, so a token never passes through the YAML (or an AI agent). Set the ones your publisher needs, then:

export CLOUDFLARE_API_TOKEN=…        # Account → Cloudflare Pages → Edit
colophon publish --env production --allow-publish --create   # --create provisions the target

Credentials by publisher:

Publisher Secret environment variables Token permission
cloudflare-pages CLOUDFLARE_API_TOKEN Account → Cloudflare Pages → Edit
cloudflare-r2 R2_ACCESS_KEY_ID / R2_SECRET_ACCESS_KEY (or AWS_*) R2 → Object Read & Write
s3 / tigris AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY Object read & write
git / github-pages GITHUB_TOKEN / GH_TOKEN (HTTPS remotes) Repo contents → write (SSH uses your agent)

You can route assets (images, audio, attachments) to R2/S3 while HTML stays on your host — see Publishing for object storage, routing, --create CORS, and the command escape hatch (surge, Netlify, rsync, …).

AI media generation

Opt in with a generation: block; keys come from the environment. Reference a prompt anywhere an image goes (hero: "gen:a lighthouse on a rocky coast"), or give a post an audio reading:

generation:
  image:
    provider: minimax            # google | openai | xai | minimax | together | deepinfra | custom
  speech:
    provider: minimax            # text-to-speech reading → themed player + podcast enclosure
    voice: "English_Graceful_Lady"
Image provider Default model API key
google gemini-3.1-flash-image GEMINI_API_KEY
minimax image-01 MINIMAX_API_KEY
openai gpt-image-1 OPENAI_API_KEY
xai grok-imagine-image-quality XAI_API_KEY

Full details — caching, providers, house style, the --generate-ai step and the kill switch — in Image & audio generation.

Themes

Pick a theme with theme: in colophon.yaml. List, inspect or eject the bundled ones with colophon themes; community themes live in contrib/themes/ (flux, obsidian, signal). To customise, eject a theme or write your own — see Themes for the template variables, progressive-enhancement contract, and base-theme inheritance.

AI authoring skills

colophon ships agent skills (write, edit, cross-link, metadata, publish) that teach an AI coding agent to drive it — the engine supplies the voice and scaffolding, the agent writes the prose. It never calls an LLM or touches your deploy secrets.

The binary installs them into whatever harness you use:

colophon skills detect    # list detected harnesses + per-skill status (installed/outdated/…)
colophon skills install   # install or update the skills into the detected harnesses

Skills go to the tool-neutral ~/.agents/skills/ (read by Codex, opencode, Cursor, Copilot), plus ~/.claude/skills/ (Claude Code) and ~/.gemini/skills/ (Gemini CLI). Each installed file carries a version marker, so re-running install updates stale copies and won't overwrite local edits without --force. Scope with --harness=…, --dir=PATH, or --all.

For Claude Code, install asks whether to use the self-updating marketplace plugin or copy files (set --claude=marketplace|files|skip to choose non-interactively). The plugin (this repo is a marketplace) is:

/plugin marketplace add jmylchreest/colophon
/plugin install colophon-skills@colophon

See contrib/skills/ for the full list.

Documentation

Guide
Authoring content Frontmatter, Markdown, rich blocks, media embeds, attachments, wikilinks
Themes Selecting/writing themes, template variables, progressive enhancement
Publishing Environments vs publishers, credentials, object-storage routing
Image & audio generation gen: prompts, TTS readings, providers, caching
Authors & personas Bylines & h-cards (Gravatar) vs hidden writing voices
SEO & social The seo: block and the metadata colophon emits

Design notes and the roadmap live in docs/PLAN.md.

Layout

cmd/colophon     CLI entrypoint
internal/        engine — render, build, sources, publishers, serve, config
search/          reusable static-search module (Go + JS, parity-tested)
contrib/themes/  community themes
contrib/skills/  AI agent skills (Claude Code / opencode plugin)
docs/            authoring, theming and publishing guides
fixtures/        end-to-end example sites

License

Apache License 2.0 © John Mylchreest.

Directories

Path Synopsis
cmd
colophon command
contrib
pronunciation
Package pronunciation embeds colophon's built-in, provider-agnostic pronunciation dictionaries so a site can reference one by name (e.g.
Package pronunciation embeds colophon's built-in, provider-agnostic pronunciation dictionaries so a site can reference one by name (e.g.
skills
Package skills embeds colophon's authoring SKILL.md files so the `colophon skills` command can install them into a detected agent harness without the repo present.
Package skills embeds colophon's authoring SKILL.md files so the `colophon skills` command can install them into a detected agent harness without the repo present.
internal
build
Package build is the content pipeline: it reads markdown from content/, renders it through the theme engine, and writes the canonical static tree to public/.
Package build is the content pipeline: it reads markdown from content/, renders it through the theme engine, and writes the canonical static tree to public/.
cli
Package cli defines colophon's command tree using kong.
Package cli defines colophon's command tree using kong.
clog
Package clog is colophon's human-facing progress log: a thin, nil-safe adapter over log/slog (via github.com/jmylchreest/slog-logfilter).
Package clog is colophon's human-facing progress log: a thin, nil-safe adapter over log/slog (via github.com/jmylchreest/slog-logfilter).
config
Package config loads colophon.yaml (sites + publishers) and the personas/*.yaml files, applying {env:VAR} interpolation and basic validation.
Package config loads colophon.yaml (sites + publishers) and the personas/*.yaml files, applying {env:VAR} interpolation and basic validation.
core
Package core holds colophon's domain model: the language-neutral types that the CLI, build pipeline, sources, and publishers all share.
Package core holds colophon's domain model: the language-neutral types that the CLI, build pipeline, sources, and publishers all share.
feed
Package feed renders syndication formats (RSS 2.0, Atom 1.0, JSON Feed 1.1) and a sitemap from a site's built pages, using only encoding/xml + encoding/json — no external dependency.
Package feed renders syndication formats (RSS 2.0, Atom 1.0, JSON Feed 1.1) and a sitemap from a site's built pages, using only encoding/xml + encoding/json — no external dependency.
generate
Package generate turns text prompts into images for colophon's `gen:` references.
Package generate turns text prompts into images for colophon's `gen:` references.
persona
Package persona assembles "write-as" context for a blog persona: its style guide and references plus the most relevant exemplars drawn from that persona's own published content.
Package persona assembles "write-as" context for a blog persona: its style guide and references plus the most relevant exemplars drawn from that persona's own published content.
profiling
Package profiling is colophon's hidden, opt-in pprof hook.
Package profiling is colophon's hidden, opt-in pprof hook.
publish
Package publish maps publisher driver names to implementations.
Package publish maps publisher driver names to implementations.
publish/cloudflare
Package cloudflare implements the "cloudflare-pages" publisher: it deploys the built tree to a Cloudflare Pages project via the direct-upload API (no wrangler).
Package cloudflare implements the "cloudflare-pages" publisher: it deploys the built tree to a Cloudflare Pages project via the direct-upload API (no wrangler).
publish/command
Package command implements the "command" publisher: it materialises the built tree to a directory and runs a user-configured CLI command against it, so any deploy tool that takes a directory — surge, netlify, vercel, wrangler, rsync, scp, aws s3 sync, a bespoke script — can be a colophon publisher without a driver of its own.
Package command implements the "command" publisher: it materialises the built tree to a directory and runs a user-configured CLI command against it, so any deploy tool that takes a directory — surge, netlify, vercel, wrangler, rsync, scp, aws s3 sync, a bespoke script — can be a colophon publisher without a driver of its own.
publish/git
Package git implements the "git" publisher (and the "github-pages" alias): it writes the built tree onto a nominated branch of a remote repository and force-pushes it, so the branch always mirrors the latest build.
Package git implements the "git" publisher (and the "github-pages" alias): it writes the built tree onto a nominated branch of a remote repository and force-pushes it, so the branch always mirrors the latest build.
publish/local
Package local implements the "local" publisher: it copies the built tree to a directory on disk.
Package local implements the "local" publisher: it copies the built tree to a directory on disk.
publish/r2
Package r2 implements the "cloudflare-r2" publisher: it uploads the built tree to an S3-compatible object store (Cloudflare R2, or any S3/MinIO via an explicit endpoint).
Package r2 implements the "cloudflare-r2" publisher: it uploads the built tree to an S3-compatible object store (Cloudflare R2, or any S3/MinIO via an explicit endpoint).
publish/s3
Package s3 implements the generic "s3" publisher and the "tigris" alias: it uploads the built tree to any S3-compatible object store using the shared S3 wire client (internal/publish/s3common).
Package s3 implements the generic "s3" publisher and the "tigris" alias: it uploads the built tree to any S3-compatible object store using the shared S3 wire client (internal/publish/s3common).
publish/s3common
Package s3common is the generic S3 client shared by S3-compatible publishers (cloudflare-r2, tigris, future backends).
Package s3common is the generic S3 client shared by S3-compatible publishers (cloudflare-r2, tigris, future backends).
render
Package render turns templates + page data into HTML behind a pluggable Engine.
Package render turns templates + page data into HTML behind a pluggable Engine.
retry
Package retry is the shared rate-limit/transient backoff used by every outbound HTTP subsystem (AI generation, webmention, websub, syndication).
Package retry is the shared rate-limit/transient backoff used by every outbound HTTP subsystem (AI generation, webmention, websub, syndication).
scaffold
Package scaffold writes the initial file tree for a new colophon project.
Package scaffold writes the initial file tree for a new colophon project.
serve
Package serve runs a local preview server.
Package serve runs a local preview server.
showcase
Package showcase provides a built-in markdown reference page, embedded in the binary, that demonstrates every content feature a theme can enrich.
Package showcase provides a built-in markdown reference page, embedded in the binary, that demonstrates every content feature a theme can enrich.
skills
Package skills installs colophon's embedded authoring SKILL.md files into whichever agent harness is present on the machine (Claude Code, Codex, opencode, Cursor, Copilot, Gemini CLI).
Package skills installs colophon's embedded authoring SKILL.md files into whichever agent harness is present on the machine (Claude Code, Codex, opencode, Cursor, Copilot, Gemini CLI).
source
Package source maps content-source driver names to implementations.
Package source maps content-source driver names to implementations.
source/mddir
Package mddir implements the "md-dir" source: a directory of markdown files.
Package mddir implements the "md-dir" source: a directory of markdown files.
source/obsidian
Package obsidian implements the "obsidian" source: one or more Obsidian vault folders, read in place (no copy).
Package obsidian implements the "obsidian" source: one or more Obsidian vault folders, read in place (no copy).
syndicate
Package syndicate implements POSSE: publish on your own site, then syndicate copies to silos (Mastodon, Bluesky, …) linking back.
Package syndicate implements POSSE: publish on your own site, then syndicate copies to silos (Mastodon, Bluesky, …) linking back.
telemetry
Package telemetry sends colophon's own build/publish events to a statsfactory instance, separate from the reader-facing web beacon.
Package telemetry sends colophon's own build/publish events to a statsfactory instance, separate from the reader-facing web beacon.
webmention
Package webmention implements the sender half of Webmention (W3C Recommendation, https://www.w3.org/TR/webmention/): after a post is live, notify every site it links to so the link can appear as a response there.
Package webmention implements the sender half of Webmention (W3C Recommendation, https://www.w3.org/TR/webmention/): after a post is live, notify every site it links to so the link can appear as a response there.
websub
Package websub implements the publisher side of WebSub (W3C Recommendation, https://www.w3.org/TR/websub/): pinging a hub after publish so it pushes the updated feed to subscribers in real time.
Package websub implements the publisher side of WebSub (W3C Recommendation, https://www.w3.org/TR/websub/): pinging a hub after publish so it pushes the updated feed to subscribers in real time.
Package markdown is colophon's content-file codec: it parses and generates the frontmatter-plus-markdown documents colophon and external tools exchange.
Package markdown is colophon's content-file codec: it parses and generates the frontmatter-plus-markdown documents colophon and external tools exchange.
search module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL