Documentation

Content & routing

Structured documents define content; directory names define stable, case-sensitive routes and navigation.

Structured page data

YAML and JSON page files are complete data documents. Common fields include a template name, title, plain content, and optional Markdown:

template: default
title: An example
content: Plain text is escaped automatically.
markdown: |
  Optional **safe Markdown** goes here.

You may add fields for your own templates. With TypeScript generics, those fields can be typed at the point of use.

Numbered navigation

Directories beginning with two digits and an underscore appear in generated navigation. The prefix controls order but is removed from the public URL.

01_about/             → /about
02_work/              → /work
03_contact/           → /contact

A numbered child directory follows the same rule. Labels come from page titles, so navigation text stays close to page content.

Unlisted routes

Unnumbered directories remain routable but do not appear in generated navigation:

legal/                → /legal, omitted from navigation
01_about/principles/  → /about/principles, omitted from navigation

This is useful for campaign pages, legal pages, and routes linked from within content rather than the main navigation.

Route names

Route directories use lowercase letters, numbers, underscores, and hyphens. Keeping route names within this set makes static and dynamic path matching identical on case-sensitive hosts.

Missing pages

Put a page document at pages/404/ to provide the not-found page. TinyJS returns the actual 404 status when that page is rendered for an unknown path.