---
title: "Theming & Design"
url: "https://docs.chinaski.net/en/theming/"
type: "page"
language: "en"
description: "Overview of Chinaski theming: the Template Toolkit files behind every public page, creating and cloning themes, and the variables, blocks and assets."
updated: "2026-09-29"
generated: "Markdown rendition of the HTML page at url, built by 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](https://docs.chinaski.net/en/theming/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](https://docs.chinaski.net/en/theming/raw-tt/)** unbranded shell, **[documents.tt](https://docs.chinaski.net/en/theming/documents-tt/)** listings, **[search.tt](https://docs.chinaski.net/en/theming/search-tt/)**, and **[offline.tt](https://docs.chinaski.net/en/theming/offline-tt/)**: each with its own page.

## Building your theme

- **[Create & Clone Themes](https://docs.chinaski.net/en/theming/create-clone/)**: 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](https://docs.chinaski.net/en/theming/letterbox/)**: the shipped default, as your reference/debug base.
- **[Variables & Helpers](https://docs.chinaski.net/en/theming/variables-helpers/)**: what every template gets in the stash (content fields, site settings, nav trees, hreflang, JSON-LD…).
- **[Blocks in Themes](https://docs.chinaski.net/en/theming/blocks-in-themes/)**: how `{{block:name​}}` shortcodes and block templates render inside any theme.
- **[Assets & SRI](https://docs.chinaski.net/en/theming/assets/)**: static asset handling; the cache-busting and integrity behavior for admin CSS (and how the static output ships its own).
- **[Design Tokens](https://docs.chinaski.net/en/theming/design-tokens/)** and **[Design Briefs](https://docs.chinaski.net/en/theming/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

[Template Files](https://docs.chinaski.net/en/theming/template-files/)

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.

[The Letterbox Theme](https://docs.chinaski.net/en/theming/letterbox/)

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 & Clone Themes](https://docs.chinaski.net/en/theming/create-clone/)

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.

[Variables & Helpers](https://docs.chinaski.net/en/theming/variables-helpers/)

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

[Blocks in Themes](https://docs.chinaski.net/en/theming/blocks-in-themes/)

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

[Assets & SRI](https://docs.chinaski.net/en/theming/assets/)

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

[Design Briefs](https://docs.chinaski.net/en/theming/design-briefs/)

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

[raw.tt Template](https://docs.chinaski.net/en/theming/raw-tt/)

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.

[documents.tt Template](https://docs.chinaski.net/en/theming/documents-tt/)

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

[search.tt Template](https://docs.chinaski.net/en/theming/search-tt/)

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.

[offline.tt Template](https://docs.chinaski.net/en/theming/offline-tt/)

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

[Design Tokens](https://docs.chinaski.net/en/theming/design-tokens/)

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