Skip to content

Route segments

The folder names in a Site set its URLs, with groups, keys, private folders and Experiment Variants.

The folder names in a Site set its URLs. A folder is a segment, and four spellings change what a segment does.

  • sites/www/
  • (legal)/security/page.mdx/security
  • blog/[post]/page.mdx/blog/:post, one Page per member
  • _drafts/hero.mdxprivate, never served
  • pricing/@annual/page.mdxan Experiment Variant of /pricing

Reference

NameURLDoes
name//nameA segment
(group)/noneGroups folders, often under a shared layout, and adds no segment
[key]//:keyOne Page per member of the Collection the Page is about
_name/nonePrivate: never served, never published
@arm/the parent'sA Variant of the parent Page in an Experiment

Examples

Minimal

sites/www/blog/[post]/page.mdx
---
about: content/blog
---
<Article />

Leaseline

blog/[post]/page.mdx serves one Page per published post, and pricing/@annual/page.mdx tests annual billing first.

sites/www/pricing/@annual/page.mdx
---
title: Pricing
---
<PriceTable offers={["pro-annual", "pro"]} />

What it builds

The SiteBuilder resolves the tree into Pages.

  • a Page per member under [key]/, added and removed as the Collection changes
  • an Experiment with one Variant per @arm/, started with Experiment.start
  • the losing arm goes dormant when Experiment.conclude picks a winner

Good to know

  • Keys come from the Collection; a slug equal to a declared Verb is refused.
  • Routing has every URL rule.