FORMAT V1
reference
8 min read

Theme Format V1, od:layout & Full HTML Documents

OpenDash Theme Format V1 uses author-owned Full HTML Documents combined with statically checked MiniJinja (3.0.5), explicit od:layout editable Studio regions, declarative Custom Blocks, and schema-driven Theme Options.

Manifest Structure (theme.json)

Every theme requires a root theme.json declaring manifest_version: 1 and a unique lowercase kebab theme_id (1..=64 characters):

theme.json json
{
  "manifest_version": 1,
  "theme_id": "my-theme",
  "name": "My Editorial Theme",
  "version": "1.0.0",
  "default_locale": "en",
  "text_domain": "my-theme",
  "core_tailwind": true,
  "templates": [
    { "kind": "index", "file": "index.html" },
    { "kind": "single", "file": "single.html" },
    { "kind": "single", "content_type": "doc", "file": "single-doc.html" },
    { "kind": "archive", "file": "archive.html" },
    { "kind": "taxonomy", "taxonomy": "category", "file": "taxonomy.html" },
    { "kind": "page", "file": "page.html" },
    { "kind": "search", "file": "search.html" },
    { "kind": "not_found", "file": "404.html" }
  ],
  "parts": {
    "header": "template-part/header.html",
    "footer": "template-part/footer.html"
  },
  "part_formats": {
    "header": "blocks",
    "footer": "blocks"
  },
  "menus": ["primary", "footer"],
  "styles": [{ "handle": "main", "src": "assets/style.css", "conditions": ["all"] }]
}

Full HTML Document & od:layout Contract

Route templates and Page Layouts own complete HTML documents (there is no fragment compatibility mode). Every template must include:

  • A single <!doctype html>, <meta charset="utf-8">, responsive viewport meta, literal {{ od_head() }} in <head>, and literal {{ od_footer() }} before </body>.
  • Explicit header/footer parts via {{ od_part("header") }} and {{ od_part("footer") }} (omitted only on canvas Chrome-free page layouts declaring "chrome": "none").
  • Exactly one static <!-- od:layout {"key":"main"} -->...<!-- /od:layout --> region directly inside <main> containing the Studio comment-block AST. Entry templates (single, page) must retain exactly one core/entry-content block inside main.
  • part_formats: {"header":"blocks","footer":"blocks"} marks parts editable in Studio Mode 1 without sacrificing full-document structure.
single.html html
<!doctype html>
<html lang="{{ locale.language_tag }}" dir="{{ locale.direction }}">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  {{ od_head() }}
</head>
<body>
  {{ od_part("header") }}
  <main>
    <!-- od:layout {"key":"main"} -->
    <!-- od:core/section {"id":"sec","props":{"tag":"section"}} -->
    <!-- od:core/row {"id":"row"} -->
    <!-- od:core/column {"id":"col"} -->
    <!-- od:core/entry-title {"id":"title","props":{"tag":"h1","size":"3xl"}} /-->
    <!-- od:core/entry-content {"id":"content"} /-->
    <!-- /od:core/column -->
    <!-- /od:core/row -->
    <!-- /od:core/section -->
    <!-- /od:layout -->
  </main>
  {{ od_part("footer") }}
  {{ od_footer() }}
</body>
</html>

Trusted MiniJinja Engine & C-SEC Execution Bounds

OpenDash executes theme MiniJinja templates inside a trusted open-by-default environment (supporting extends, include, import, macro, tojson, and tojson_attr) combined with deterministic C-SEC AST and runtime resource budgets:

Constraint / BudgetEnforced BoundPurpose
MiniJinja Version & Auto-Escapeminijinja =3.0.5, unconditional AutoEscape::Html, strict undefined varsPrevents XSS and silent missing-variable rendering bugs
Request Execution Fuel<= 10,000 total fuel per request (<= 2,000 per block node)Eliminates runaway template loops or quadratic macro expansion
HTML Output & Part Depth<= 512 KiB rendered HTML, od_part() depth <= 3 (max 32 expansions), recursion <= 16Guarantees predictable latency and blocks recursive part cycles
Static Security ChecksDunder __ rejected, no {{ ... }} inside <script> or on* attributes, typed URL provenance checksBlocks template injection, script smuggling, and untrusted URL interpolation

Package Validation Ceilings & Safe Isolation

Both CLI validation and Admin ZIP upload enforce strict archive boundaries: maximum 8 MiB compressed ZIP, 32 MiB aggregate decoded size (100:1 expansion cap), 256 files, 256 KiB per manifest or template file, and 8 MiB per raster asset, with zero symlinks or path traversal.

Next Steps

Edit Source URL:

Search OpenDash

Use Arrow keys & Enter to navigate Full search page →