Status: Superseded by v0.3
This document is kept for historical reference only. New validation, upload, and submission flows must use v0.3: Theme Runtime v0.3
dev, validate, pack) is external to the runtime contract.A ZeroPress theme is responsible only for:
theme.json)Out of scope:
Baseline structure compatible with current build/upload pipelines:
my-theme/
theme.json
layout.html
index.html
post.html
page.html
archive.html
category.html
tag.html
404.html (optional)
partials/
*.html
assets/
style.css
theme.js (optional)
Key points:
.html files.partials/ is optional.assets/style.css is required.assets/theme.js is optional and is not auto-executed by the runtime contract.archive.html, category.html, and tag.html are optional capabilities. If a theme omits them, related route outputs are omitted even when preview-data still contains those route arrays.404.html is optional. When present, build tooling may emit a 404.html artifact; when absent, that artifact is omitted.theme.json v0.2Minimal example:
{
"name": "My Theme",
"namespace": "your-namespace",
"slug": "my-theme",
"version": "0.2.0",
"license": "MIT",
"description": "A ZeroPress theme.",
"runtime": "0.2"
}
Required fields:
name (string, 1-80 chars)namespace (string, 3-24 chars)slug (string, 3-32 chars)version (semver)license (enum)runtime (must be "0.2")Optional fields:
author (string, 1-80 chars if present)description (string, up to 280 chars)License enum:
MITApache-2.0BSD-3-ClauseGPL-3.0-onlyGPL-3.0-or-laterIdentity rules:
namespace and slug must follow the ZeroPress package naming rulesnamespace must match the registered publisher namespace in directory-backed submission flowsslug is the canonical theme identifier within a namespacelayout.html must include exactly one ``.content, header, footer, meta.<script> tags are not allowed in layout.html.,).Commonly excluded files:
.gitnode_modulesdist*.log__MACOSX, .DS_Storepackage-lock.json, pnpm-lock.yaml, yarn.lock, bun.lockbErrors:
theme.json or invalid JSONlayout.html, index.html, post.html, page.html)assets/style.cssversion semverlicenseruntime not equal to "0.2"namespace or sluglayout.html slot rule violationsWarnings:
archive.html, category.html, tag.htmlpost.html missing ``post.htmlRuntime behavior:
archive, category, and tag pages are emitted only when both renderable route data exists and the matching template exists.404.html is emitted only when the theme provides a 404.html template.npx zeropress-theme validate, pack, and dev use this runtime contract as the baseline.
v0.2 is kept for historical reference only.v0.3.>= 18.18.0| Item | Classification | Notes |
|---|---|---|
theme.json, layout.html, index.html, post.html, page.html, assets/style.css |
Normative (Required) | Missing files produce validation errors |
theme.json.name, theme.json.namespace, theme.json.slug, theme.json.version, theme.json.license, theme.json.runtime |
Normative (Required) | Must be present and valid |
theme.json.author |
Informative (Optional) | Optional package display metadata |
theme.json.description |
Informative (Optional) | Recommended metadata for theme clarity |
layout.html must contain exactly one `` |
Normative (Required) | Validation error if violated |
Allowed slots: content, header, footer, meta |
Normative (Required) | Unknown slots are invalid |
No <script> in layout.html |
Normative (Required) | Validation error |
Mustache block syntax forbidden (,) |
Normative (Required) | Validation error |
| Path/symlink root escape forbidden | Normative (Required) | Validation error |
archive.html, category.html, tag.html |
Informative (Recommended) | Missing files produce warnings |
partials/ directory |
Informative (Optional) | Supported but not required |
assets/theme.js |
Informative (Optional) | Optional file; not auto-executed |