
This repository provides a structured approach to managing HTML/CSS templates and blocks for the Windbase platform. It includes:
- JSON Schema Validation with Zod
- CLI Tools for creating and managing templates
- Separate HTML Files for better editing experience
- Automated CI/CD pipeline with GitHub Actions
- GitHub Pages API for dynamic template loading
bun install
bun windbase create
You will be prompted to enter the name and category of the block/template.
bun run validate
# For block
bun windbase preview -b <block-id>
# For template
bun windbase preview -t <template-id>
When you create a block or template, the CLI generates both JSON and HTML files:
src/blocks/hero/sample-hero/
├── sample-hero.json # Schema and metadata
└── sample-hero.html # HTML content
- Better editing experience - Edit HTML in your favorite editor with syntax highlighting
- Version control friendly - Cleaner diffs for HTML changes
- API flexibility - Serve JSON schema and HTML content separately
- No escaping needed - Pure HTML without JSON string escaping
bun windbase create
You will be prompted to enter the name and category of the block.
- Edit
src/blocks/hero/hero-section/hero-section.json
for metadata - Edit
src/blocks/hero/hero-section/hero-section.html
for HTML content
You can generate a preview image for your block or template by running the following command:
bun windbase preview -b <block-id>
bun run build
bun run format:write
- Format code with Biomebun run build
- Build distribution files and API structurebun run validate
- Validate all schemas
- Update the category enums in
src/schemas/categories.ts
- Run validation to ensure consistency
- Update documentation as needed
The repository includes two GitHub Actions workflows:
- CI (
ci.yml
): Validates schemas and builds on every push/PR - Deploy (
deploy.yml
): Deploys to GitHub Pages on main branch updates
MIT
- Fork the repository
- Create a feature branch
- Make your changes
- Run validation and tests
- Submit a pull request