create-zeropress-theme
v0.5.1
Published
ZeroPress v0.5 starter generator
Maintainers
Readme
create-zeropress-theme
ZeroPress v0.5 starter generator.
This package creates a small buildable ZeroPress starter project for the
preview-data.json + theme/ workflow.
Quick Start
npx create-zeropress-theme --theme-slug my-portfolio --template portfolio
cd my-portfolio
npm install
npm run buildThe build output is written to dist/.
For local preview while developing the theme:
npm run devUsage
create-zeropress-theme --theme-slug <slug> --template <template>Required Options
--theme-slug <slug>: starter directory name and generatedtheme.json.slug--template <template>:minimal,blog,docs,portfolio, ormagazine
Other Options
--help,-h: show help--version,-v: show package version
Templates
minimal: clean content-first blog starter.blog: editorial blog starter with menus, widgets, posts, categories, and tags.docs: compact documentation starter with pages, navigation, and page TOC.portfolio: personal portfolio starter usingsite.metaand named collections.magazine: editorial magazine starter with sectioned landing and post lists.
Each template includes a matching preview-data.json fixture. The fixture is
part of the starter because different theme categories need different render
data shapes.
Generated Project
my-portfolio/
package.json
preview-data.json
theme/
theme.json
layout.html
index.html
post.html
page.html
archive.html
category.html
tag.html
404.html
partials/
assets/Generated package.json includes:
{
"scripts": {
"build": "zeropress-build ./theme --data ./preview-data.json --out ./dist",
"dev": "zeropress-theme dev ./theme --data ./preview-data.json"
},
"dependencies": {
"@zeropress/build": "0.5.2",
"@zeropress/theme": "0.5.1"
}
}Generated theme/theme.json is rewritten with:
$schema: "https://zeropress.dev/schemas/theme.v0.5.runtime.schema.json"runtime: "0.5"namespace: "my-company"slugandnamefrom--theme-slugversion: "0.1.0"
Update namespace, name, and demo fixture content before publishing a theme.
Validation
The generated theme is validated immediately with
@zeropress/theme-validator.
The package test suite also builds every bundled starter with
@zeropress/build to verify
that each template and fixture works together.
Requirements
- Node.js >= 18.18.0
- ESM-only package
Related
License
MIT
