zeropress.dev

ZeroPress Theme Runtime Spec v0.1

Status: Active (aligned with the current runtime and CLI toolchain)

0. Core Philosophy

1. Scope

A ZeroPress theme is responsible only for:

Out of scope:

2. Runtime Contract (Current)

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:

2.1 Optional Devtools Layer

Using create-zeropress-theme --with-devtools may add local development files (for example, package.json) to the theme directory.

Important:

3. theme.json (Current)

Minimal example:

{
  "name": "my-theme",
  "version": "0.1.0",
  "author": "Author Name",
  "description": "Theme description"
}

Required fields:

Recommended field:

4. Template Rules

5. Variables and Rendering

6. Security and Packaging Rules

Commonly excluded files:

7. Validation Profile

Errors:

Warnings:

8. CLI Alignment

npx zeropress-theme validate, pack, and dev use this runtime contract as the baseline.

9. Compatibility Notes

10. Toolkit Baseline

Initial package versions:

11. Normative vs Informative Summary

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