Built with Chinaski

Theming & Design

A Chinaski theme is a directory of Template Toolkit files that the static builder renders into every public page: the complete control point for how a site looks. This section covers the shipped theme, every template file it’s made of, how to create and clone your own, and the variables/blocks/assets lands that make output safe.

The template model (start here)

  • Template Files: the site-template set (page.tt, post.tt, blog_index.tt, 404, search, offline, and the _-prefixed partials), the theme-first search order with built-in fallbacks, and how per-page templates pick their file.
  • The per-base templates: the raw.tt unbranded shell, documents.tt listings, search.tt, and offline.tt: each with its own page.

Building your theme

  • Create & Clone Themes: the upload path (archive rules, required files, the security scan), cloning any theme (what cloning the default means: an empty directory with fallback behavior), and export.
  • The Letterbox Theme: the shipped default, as your reference/debug base.
  • Variables & Helpers: what every template gets in the stash (content fields, site settings, nav trees, hreflang, JSON-LD…).
  • Blocks in Themes: how {{block:name​}} shortcodes and block templates render inside any theme.
  • Assets & SRI: static asset handling; the cache-busting and integrity behavior for admin CSS (and how the static output ships its own).
  • Design Tokens and Design Briefs: setting brand values once (tokens) and the AI-assisted generation flow for a new theme from a brief.

What you should know before starting

  • Fallbacks make it safe. An active theme’s directory is searched first, built-ins second. A theme only ships the files it changes; a theme missing standard files still builds (it just uses the built-ins unchanged). A clone from the default theme starts as an empty theme directory for exactly this flow.
  • Everything is .tt files. Template Toolkit basics (escaping (| html/| uri), INCLUDE/PROCESS, whitespace chomp) are in the security/variables pages, with the rules of what must be escaped (everything user-supplied except body and json_ld).
  • Errors don’t kill builds. Per-template render failures record an error in the build log and continue; the dashboard names the first few failing templates.

Security bottom line

The theme editor only accepts safe templates (the scan runs on upload), and the educative content in the built-in Theme Authoring doc covers the escaping rules; treat those rules (escape user data, minimal inline scripts, treat snippet editors carefully) as standing advice for your own theme files.

Also in Theming & Design

The Template Toolkit files a Chinaski theme is made of: page.tt, post.tt, blog_index.tt, 404.tt and the rest, where they live, and the lookup rules.

A map of the Letterbox default theme: where its templates live in builder/site_templates/, what each .tt file renders, and how to clone it.

Create a theme by uploading an archive or cloning an existing one: accepted formats, the six required template files, and exporting a clean hand-off.

See the variables themes receive from the builder, from URLs and dates to menus and design tokens, and how precomputed helpers work.

How the builder maps block types to templates in builder/block_templates/: cycle detection, language fallback, and what themes can expect.

Understand the two asset tracks, public site and admin app, and the reload rule: restart the app after editing its five SRI-hashed files.

Upload a design brief of reference HTML and CSS so Claude or another assistant can generate a matching theme, without touching your live site.

Use the raw.tt page template when the page body should be emitted verbatim as the full HTML file: when to choose it, and what still applies inside.

How documents.tt renders the public /documents/ listing: the card grid, type icons and meta badges, the empty state, and which documents are included.

How search.tt builds the public search page: the form, live results, and the per-language search-index.json that is filtered in the visitor's browser.

Understand offline.tt, the template behind the PWA offline fallback page: what it renders, the noindex behavior, and when it is built.

Manage design tokens, the CSS custom properties stored in the database and emitted as :root declarations: the admin screen, build flow, and naming.

Read this site in