Status: Active (aligned with the current runtime and CLI toolchain)
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 effectively required.assets/theme.js is optional and is not auto-executed by the runtime contract.basePrefix).Using create-zeropress-theme --with-devtools may add local development files (for example, package.json) to the theme directory.
Important:
node_modules and lockfiles are excluded from packaging.zeropress-theme commands (no extra local dependencies required by default).theme.json (Current)Minimal example:
{
"name": "my-theme",
"version": "0.1.0",
"author": "Author Name",
"description": "Theme description"
}
Required fields:
name (string)version (semver)author (string)Recommended field:
description (string)layout.html must include exactly one ``.content, header, footer, meta.<script> tags are not allowed in layout.html.,).../ or absolute path traversal).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 semverlayout.html slot rule violations,)Warnings:
archive.html, category.html, tag.htmlnpx zeropress-theme validate, pack, and dev use this runtime contract as the baseline.
pack generates root-flat ZIP output by default.>= 18.18.0Initial package versions:
create-zeropress-theme@0.1.0zeropress-theme@0.1.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.version, theme.json.author |
Normative (Required) | Must be non-empty strings; version must be semver |
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 in standard checks |
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, not errors |
theme.json.description |
Informative (Recommended) | Recommended metadata for better theme clarity |
partials/ directory |
Informative (Optional) | Supported but not required by runtime contract |
assets/theme.js |
Informative (Optional) | Optional file; not auto-executed by runtime contract |
Devtools files (package.json, scripts, lockfiles) |
Informative (Local tooling layer) | Useful for local workflows; excluded from packaging |