Templates
Templates are collections of pages that compose blocks into complete websites. They're pure manifests — no component code, just configuration.
What is a Template?
A template defines a multi-page site by combining blocks with content. Unlike blocks, templates have no React component. They consist of:
- pages.json — defines all pages, their blocks, and content
- block.config.ts — template metadata and global settings schema
- package.json — dependencies and template info
pages.json Structure
The pages.json file is the heart of a template. It defines layout positions (header, footer) and individual pages with their blocks:
Layout Positions
Layout positions are blocks that appear on every page. The most common are:
- header — site navigation, rendered at the top
- footer — site footer, rendered at the bottom
- sidebar_left — documentation sidebar
Each layout position specifies a block type and its content. This content is shared across all pages.
Publishing Templates
When you publish a template, the CLI:
- Publishes all referenced blocks that have changed
- Creates or updates all pages defined in
pages.json - Sets up layout positions (header, footer)
Templates don't have source code to compile — they're pure configuration. This makes publishing fast and reliable.
Dev Preview
Run cmssy dev and click on a template to see a full composed preview. The dev server renders all blocks on each page with a navigation bar to switch between pages. Use Ctrl+K to quickly jump to any page.