Requirements
- Node.js (to run each layout's
build-templates.js) - Optional: VS Code Static Web Apps extension for local static-site workflows
Build workflow (per layout)
Run the build script inside any layout folder:
cd src/Layouts/<layout-folder>
node build-templates.js
The script:
- Cleans generated
.htmlfiles in the layout root (keeps_source/andckeditor-content.css). - Merges
_source/base-template.htmlwith shared components in_source/layout-components/and page content in_source/content/<page>/. - Supports optional
head.htmlandend.htmlin each page folder for page-specific head/end injections. - Writes
<page>.htmlfiles next to the script and warns if required Cosmos/SkyCMS elements are missing.
Build all layouts at once
From the repo root, run the helper PowerShell script to execute every layout build:
pwsh -File build-layouts.ps1
It walks each src/Layouts/<layout> folder, runs its build-templates.js, and returns you to the root when done. Any layout errors are shown inline.
Add or edit a page
- Create a folder in
_source/content/(e.g.,_source/content/about/). - Add
content.html(required) plus optionalhead.htmlandend.htmlfor page-specific head/end markup. - Add the page entry to that layout's
catalog.json. - Run
node build-templates.jsfrom the layout folder to regenerate the compiled HTML.
Add a new design
- Fork the repo and copy
src/Layouts/template-starter/to a new folder undersrc/Layouts/. - Update
_source/layout-components/head.htmlwith your CSS framework or custom styles. - Add or edit pages in
_source/content/. - Run
node build-templates.jsinside your new layout folder to generate the outputs. - Open a pull request when ready; once merged, your design joins the catalog.
Questions?
Email support@moonrise.net.