What you will build: A validated Format V1 theme scaffold running with live-reload against an isolated OpenDash site directory, ready to package into an installable .zip bundle or drop into themes/<slug>/.
Step 1: Scaffold, Live-Reload & Package
Generate a minimal full-document theme scaffold (theme.json, index.html, single.html, 404.html, assets/style.css) and mount it directly in dev mode:
opendash new theme my-theme --dir ./my-theme
mkdir -p ./dev-site
OPENDASH_SITE_ROOT=./dev-site OPENDASH_PORT=18767 \
opendash serve --dev --dev-theme ./my-theme
Run static C-SEC/manifest checks before packaging. opendash pack theme automatically excludes .git, node_modules, target, .DS_Store, and *.swp, rejects symlinks, and validates the generated archive:
opendash check theme ./my-theme
opendash pack theme ./my-theme --out ./my-theme.zip
opendash check theme ./my-theme.zip
Export the authoritative Theme and Block JSON Schemas for editor autocomplete, or trigger manual manifest resync when developing in dev mode:
opendash schema theme > theme.schema.json
opendash schema block > block.schema.json
Step 2: How --dev-theme & Error Overlay Work
When running with --dev --dev-theme <dir>, OpenDash mounts your theme directory directly without manual ZIP re-uploads:
- Immediate Template Reload & Overlay: HTML templates, theme parts, blocks, and assets respond with
no-storecache policy; C-SEC parse or MiniJinja errors surface an actionable diagnostic Error Overlay rather than failing silently. - Folder-Based Themes Without --dev: You can also place ready themes under
<site_root>/themes/<slug>/directly and activate or preview them with?preview_theme=<slug>. - Manifest Sync Endpoint: Authenticated Admin sessions can invoke
POST /api/admin/dev/syncto refresh theme declarations cleanly while keeping site options and content intact.
Step 3: Install, Activate & Upgrade Without Losing Data
Upload your validated .zip bundle under Appearance → Themes (Storage Format 2) and click Activate explicitly. Upgrading an installed theme replaces its package descriptor cleanly (PUT /api/admin/themes/package/{key} with If-Match: "pkg-<generation>") while preserving custom post types, entries, menus, media, and theme options.
Next Steps
- Read the full Theme Format V1 Reference covering
theme.json,od:layout, and MiniJinja C-SEC limits. - Author reusable blocks, Tailwind tokens, and
functions.jsin Custom Studio Blocks, Tailwind Tokens & Patterns.