Products
A product is the outermost division of a trail site: one documented thing, with its own landing page, its own color, and its own URL prefix. A site root accepts products and root anthologies. Every page belongs to one of those root collections.
On this site, pekit, provium and trail are products. So is peios
itself — products are not necessarily software packages, they are the largest
chunk of documentation a reader would think of as one subject.
The directory #
A product is a directory named <slug>.product at the site root, or on a
root shelf.
It has no order prefix.
learn/
├── trail.toml
├── pekit.product/ → /pekit
└── trail.product/ → /trail
A root shelf only adds a heading in the Documentation menu and on the front page. Its products keep the URLs they would have at the root.
The slug becomes the URL prefix (/pekit) and the first segment of every
~link into that product. It must be
lowercase kebab-case, and it can not be assets or pagefind — those collide
with the output directories trail writes.
The config #
Every product needs a trail.toml, and all four keys are required:
# pekit.product/trail.toml
= "pekit"
= "pk"
= "#22c55e"
= "The recipe-driven build and packaging tool — declarative recipes in; built, tested, packaged software out."
| Key | Meaning |
|---|---|
title | The product's display name, used everywhere the product is named. Unlike other containers, this is not derived from the slug — a product always states it. |
monogram | A very short string — usually two characters — shown on the product's tile, on the front-page card and at the top of the product page. Initials or a shortened name. |
color | A #rrggbb hex color. Any other form is a build error. |
description | One sentence, shown on the front-page card, under the product's name on its own page, and in llms.txt. It is also the product page's meta description. |
One optional key, inline_ref, claims phrases that auto-link to the product
page wherever they appear in prose; see
Inline references.
An icon #
Another optional key, icon, names an SVG file beside the product's
trail.toml. The icon takes the place of the monogram tile on the front-page
card, in the products menu and at the top of the product page:
# pekit.product/trail.toml
= "pekit.svg"
The icon is drawn at the tile's size with no tile behind it, so a mark that
wants a box draws its own. Where the SVG uses currentColor, it takes the
tile's color, which follows the product's color and the reader's theme. A
multi-colored icon keeps its own colors. The monogram is still required: it
is what a tree without the icon shows.
The file's root element must be <svg> with
xmlns="http://www.w3.org/2000/svg", and it must not have an id: trail
gives it one so that pages can draw it with <use>. The build publishes the
file once, at /assets/icons/<slug>.svg, and every page refers to it there.
When trees merge, any of them can set a product's icon, and trees that set
it must have identical SVGs. A component tree can leave the icon to the site
that merges it, and its own standalone build shows the monogram instead.
What the color does #
color is the product's accent, and by default it displaces the site accent
on every page belonging to that product: card borders and hover states, the
tile, sidebar highlights, heading numbers, RFC-2119 keywords, focus rings.
Setting product_theming = false in the root trail.toml turns this off
site-wide, and everything tints from the site accent instead. Products still
keep their monogram and card, they stop coloring their pages. See
Theming.
What a product contains #
A product directory holds its trail.toml and nothing but grouping
directories:
- Anthologies
(
.antho) — a titled landing page with its own children, for products big enough to need a second level. - Topics (
.topic) — a set of articles read in any order. The everyday container. - Books (
.book) — a formal, ordered document with a cover page, numbered sections and appendices. - Shelves (
.shelf) — a titled heading grouping some of the above on the product page. No URL segment of its own.
Articles, images, and .link files can not sit directly in a product
directory; they live inside topics and books. A product with nothing in it is
legal and renders an empty landing page.
Small products go straight to topics:
pekit.product/
├── trail.toml
├── 1--getting-started.topic/
├── 2--recipes.topic/
├── 3--running.topic/
└── 4--reference.topic/
Large ones add a layer:
peios.product/
├── trail.toml
├── 1--security-fundamentals.antho/
├── 2--using-peios.antho/
├── 3--advanced-peios.antho/
├── 4--developing-for-peios.antho/
└── 5--peiso.antho/
Both shapes are ordinary. Reach for an anthology when a product's topic list has grown long enough that readers have to hunt through it.
The product page #
Every product gets a landing page at /<slug>, built from the config and its
children:
- A hero with the monogram tile or icon, the title and the description.
- A "Documentation" section listing every child as a card. Anthologies and books get a card with their description; topics get a card listing their articles — all of them when there are four or fewer, otherwise the first three and a "See all N articles" link — with a count and the topic's total reading time.
- Each shelf becomes a subheading above its own row of cards. Runs of items outside any shelf render as an untitled row, in place.
Ordering #
Products have no order prefix. They sort by the root trail.toml's featured
list — in that list's order — and then everything not listed, by title.
# learn/trail.toml
= ["peios", "pekit", "provium", "universal-directory", "trail"]
The front page shows only featured products. An unfeatured product is still
built, searchable, linkable, and listed in the documentation menu. Naming a
product that does not exist in featured is a build error. A product on a
root shelf is named by its slug alone, and appears under its shelf's heading
in both the menu and the front page.
Roll-ups #
A product totals up what is beneath it. Its reading time is the sum of every
article's, and its updated date is the most recent updated: in the whole
product. Anthologies, topics, books, and chapters do the same at their own
level. See
Articles and frontmatter.
When to add a product #
A product is a heavy division: its own color, its own landing page, its own URL prefix, and a separate card on the front page. Add one when readers would go looking for the subject by name and would not expect to find it filed under something else.
Within a single product, the lighter divisions — anthologies for a second level of landing pages, shelves for a heading, topics for a set of articles — are almost always the better answer.