zeropress.dev

ZeroPress Theme Runtime Spec v0.2

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

0. Core Philosophy

1. Scope

A ZeroPress theme is responsible only for:

Out of scope:

2. Runtime Contract

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:

3. theme.json v0.2

Minimal 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:

Optional fields:

License enum:

Identity rules:

4. Template Rules

5. Variables and Rendering

6. Security and Packaging Rules

Commonly excluded files:

7. Validation Profile

Errors:

Warnings:

Runtime behavior:

8. CLI Alignment

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

9. Compatibility Notes

10. Toolkit Baseline

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.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