zeropress.dev

ZeroPress Theme Runtime Spec v0.3

Status: Active (current manifest contract for validation and uploads)

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

Minimal example:

{
  "name": "My Theme",
  "namespace": "your-namespace",
  "slug": "my-theme",
  "version": "0.3.0",
  "license": "MIT",
  "description": "A ZeroPress theme.",
  "runtime": "0.3",
  "menuSlots": {
    "primary": {
      "title": "Primary Menu",
      "description": "Main header navigation"
    },
    "sidebar": {
      "title": "Sidebar Menu"
    }
  }
}

Required fields:

Optional fields:

License enum:

Identity rules:

3.1 menuSlots

menuSlots is an optional object that declares which menu_id values a theme commonly expects.

Recommended slot ids:

Validation rules:

3.2 Menu Slots vs Template Slots

Menu slots are distinct from template slots.

Defining menuSlots does not change template rendering rules or allowed template slot names.

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
theme.json.menuSlots Informative (Optional) If present, it must satisfy the runtime schema
layout.html must contain exactly one `` Normative (Required) Validation error if violated
Allowed template 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