Example site layouts and page templates that can be imported into Cosmos CMS (now SkyCMS). Each layout lives in src/Layouts/<layout-name> and includes a build script to generate finished HTML pages from source snippets.
- Node.js (for running
build-templates.jsin each layout folder) - Optional: VS Code Static Web Apps extension for local static-site workflows
Each layout folder contains build-templates.js. Run it from inside that layout to regenerate the compiled pages:
cd src/Layouts/<layout-folder>
node build-templates.jsWhat the script does:
- Cleans existing generated
.htmlfiles in the layout root (leaves_source/andckeditor-content.cssuntouched). - Merges
_source/base-template.htmlwith shared components in_source/layout-components/and page content in_source/content/<page>/. - Supports optional
_source/content/<page>/head.htmland_source/content/<page>/end.htmlfor per-page head/end injections. - Writes
<page>.htmlfiles next to the script and warns if required Cosmos/SkyCMS elements are missing.
From the repo root, run the helper script to execute every build-templates.js under src/Layouts:
pwsh -File build-layouts.ps1The script walks each layout folder, runs its build, and returns you to the root when finished. Errors from any layout are shown inline so you can address them quickly.
- In
_source/content/, create a folder per page (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. - From the layout folder, run
node build-templates.jsto regenerate the compiled HTML.
- 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.htmloutputs. - Open a pull request when ready. Once merged, your design joins the catalog.
If you have questions, please email: support@moonrise.net.