Single-binary static site generator for technical documentation, written in Go
翻译准备中
正在加载完整 README。
查看完整 README ↗A single-binary static site generator for technical documentation, written in Go. Tryck is Swedish for "print".
Documentation: https://tryck.pinta.land/.
::: directives: admonitions, collapsible details and tabs that work without JavaScript.file:line:col: severity[code]: message, and the build reports all of them at once..md links rewritten to page URLs, clean URLs, sitemap, feeds, llms.txt, search, redirects, and subpath deploys such as GitHub Pages project sites.::: directives from templates and plugins in JavaScript, run by the stock binary. Go plugins for everything else.srcset.llms.txt with Markdown copies of every page./v1/, /v2/ next to the current docs, with a version picker; tryck snapshot freezes a release.tryck dev rebuilds in memory, reloads the browser and shows build errors as an overlay.tryck init my-docs
cd my-docs
tryck dev # http://127.0.0.1:8080/
tryck build # writes dist/
Install with Homebrew on macOS (brew install pinta365/tap/tryck) or Scoop on Windows (scoop bucket add pinta365 https://github.com/Pinta365/scoop-bucket, then scoop install tryck), download a binary for Linux, macOS or Windows from the releases page, or build from source with Go 1.26 or later:
go install github.com/Pinta365/tryck/cmd/tryck@latest
tryck build [--config tryck.config.yaml] [--output ./dist] [--drafts] [--base-url URL] [--workers N] [--strict] [--verbose]
tryck dev [--config tryck.config.yaml] [--port 8080] [--host 127.0.0.1] [--open] [--verbose]
tryck init [dir]
tryck version
Exit codes: 0 success, 1 build errors (or warnings with --strict), 2 usage or config errors. CLI flags override the config file, which overrides built-in defaults.
content/
├── index.md → /
└── 01-guide/
├── _index.md → /guide/ (section title and weight)
├── 01-install.md → /guide/install/
└── diagram.png → /guide/diagram.png
weight in front matter wins over them.[Install](01-install.md#download).draft: true appear in tryck dev with a banner and are left out of tryck build unless you pass --drafts.Directives:
:::note[Optional title]
Any **Markdown**.
:::
:::tabs{group=lang}
@tab Go
```go
x := 1
```
@tab TypeScript
```ts
const x = 1;
```
:::
The built-in theme is configured in tryck.config.yaml; most sites need nothing else:
theme:
accent: "#0b7a5a" # links, active nav, tabs
logo: /img/logo.svg # from static/
colorScheme: auto # auto (follows the system, with a toggle), light or dark
nav: # header links
- title: GitHub
url: https://github.com/you/project
footer: "© 2026 You. Built with [tryck](https://github.com/Pinta365/tryck)."
css: [/css/custom.css] # extra stylesheets, loaded last
Its styles live in /css/tryck.css and use CSS variables (--fg, --bg, --font, --accent, ...), so a stylesheet in theme.css can restyle the site without touching templates.
Theme folders package layouts, static files and defaults for reuse. Point theme.path at one:
themes/acme/
├── theme.yaml # defaults for the theme section (accent, logo, footer, params, ...)
├── layouts/ # replaces built-in layouts with the same name
└── static/ # copied to the output root
Files are looked up in the site first, then the theme, then the built-in theme: layouts/partials/footer.html in your site beats the theme's, which beats tryck's. Settings in tryck.config.yaml win over theme.yaml key by key, except css: the site's stylesheets are added after the theme's. Custom values for a theme's templates go in theme.params and are available as .Theme.Params.
Layouts are Go html/template files. To add analytics or other tags to every page, create layouts/partials/head-end.html or body-end.html; both are empty by default. See the built-in set in internal/render/layouts. Templates get .Site, .Page, .Content, .Nav, .TOC, .Prev, .Next and .Theme, and the functions relURL, absURL, dateFormat, markdownify, slugify, partial, default, dict and jsonify.
A template in layouts/directives/ adds a directive: layouts/directives/card.html renders :::card[Title]{href="guide/setup.md"} blocks, with the title, attributes and rendered body as template data; href and src are rewritten and checked like Markdown links. No code or build step. See Custom directives.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗