Config file

tryck reads tryck.config.yaml from the current directory unless --config names another file. The directory that holds the config file is the project root: relative directories such as contentDir resolve against it.

Every key has a default, so a site only needs to set what it changes. This is the complete default configuration:

 1site:
 2  title: ""
 3  description: ""
 4  baseUrl: "/"
 5  language: "en"
 6
 7build:
 8  contentDir: "./content"
 9  outputDir: "./dist"
10  staticDir: "./static"
11  layoutsDir: "./layouts"
12  pluginsDir: "./plugins"
13  cleanOutput: true
14  drafts: false
15  unsafeHTML: false
16  workers: 0
17
18defaults:
19  layout: "doc"
20  toc: true
21  tocDepth: [2, 3]
22  dateFormat: "2006-01-02"
23
24theme:
25  path: ""
26  accent: ""
27  accentDark: ""
28  logo: ""
29  colorScheme: "auto"
30  nav: []
31  footer: ""
32  css: []
33  params: {}
34
35plugins:
36  readingTime:
37    enabled: true
38    wordsPerMinute: 200
39  syntaxHighlighting:
40    enabled: true
41    theme: "github"
42    darkTheme: "github-dark"
43    lineNumbers: true
44  linkCheck:
45    enabled: true
46    failOnBroken: true
47  sitemap:
48    enabled: true
49  search:
50    enabled: true
51  mermaid:
52    enabled: true

The toc and redirects plugins are enabled as well; they need no section. The plugin reference lists every plugin, its options and defaults.

Precedence

Values are applied in this order, each layer winning over the one below:

  1. a command-line flag,
  2. the config file,
  3. the built-in default.

Setting one option of a plugin does not drop its other defaults; plugin sections are merged key by key.

site

Key Type Default Meaning
title string "" Site name, used in the header, <title> and as a title fallback.
description string "" Default <meta name="description"> for pages without one.
baseUrl string "/" The site's URL or path. Always ends in /. Prefixes internal links and builds absolute URLs for the sitemap.
language string "en" Value of the <html lang> attribute.

baseUrl may be an absolute http(s):// URL, or a path starting with /. Anything else, or an http(s) URL without a host, is a config.invalid error. The sitemap needs absolute URLs, so with a path-only baseUrl it is skipped with a sitemap.baseUrl warning.

build

Key Type Default Meaning
contentDir string "./content" Directory scanned for Markdown pages and their assets.
outputDir string "./dist" Where tryck build writes the site.
staticDir string "./static" Files copied to the site root unchanged.
layoutsDir string "./layouts" Layout overrides.
pluginsDir string "./plugins" Script plugins.
cleanOutput bool true Empty the output directory before writing.
drafts bool false Include pages with draft: true.
unsafeHTML bool false Pass raw HTML in Markdown through instead of replacing it with a comment.
workers int 0 Parallel workers for parsing and rendering; 0 uses one per CPU.

The directory keys must not be empty, and workers must be 0 or positive.

defaults

Key Type Default Meaning
layout string "doc" Layout for pages that do not set one.
toc bool true Show a table of contents; a page's toc front matter overrides it.
tocDepth [min, max] [2, 3] Heading levels included in the table of contents. Each is 1–6 and min ≤ max.
dateFormat string "2006-01-02" Go time layout used by dateFormat when no layout is passed.

theme

The theme section configures the built-in theme and selects an optional theme folder. See The built-in theme and Theme folders.

Key Type Default Meaning
path string "" A theme folder with theme.yaml, layouts/ and static/.
accent string "" CSS colour for links, active navigation and tabs.
accentDark string "" Accent in dark mode; empty derives one from accent.
logo string "" Site path of an image shown in the header.
colorScheme string "auto" auto (follows the system, with a toggle), light or dark.
nav list [] Header links, each with title and url (both required).
footer string "" Inline Markdown shown in the site footer.
css list [] Extra stylesheets, linked after the theme's. With a theme folder, they are added after the folder's own css.
params map {} Free-form values for custom themes, read as .Theme.Params.

accent and accentDark must be CSS colours: a hex value, a colour name, or a function such as rgb(...). colorScheme must be auto, light or dark.

plugins

plugins maps a plugin's name to its own settings section, which each plugin reads. Every plugin also understands enabled, a boolean that turns the plugin off:

1plugins:
2  linkCheck:
3    enabled: false
4  readingTime:
5    wordsPerMinute: 250

A key a plugin does not know is a config.unknownKey warning, as is a plugin name that does not exist.

Unknown keys and other diagnostics

A key that is not in a section's list above is reported as config.unknownKey, a warning that names the full path section.key. YAML that does not parse is config.yaml, and a value that decodes but makes no sense is config.invalid. See Diagnostics.