yet another static website generator. Transforms ejs based templates to pages
- Generate full-static websites
- Parallel processing using ES6 promise/await
- Templates based on ejs
- Plugin system to inject custom functions into templates
$ yarn global add sculpture.js
Just run sculpture update
within your current project directory. All ejs
file within the pages/
directory will be rendered and written to dist/
directory. Thats it!
The generator should be invoked as final step after any task runners like grunt/gulp have been executed.
Each project needs a json based configuration file within the root directory named sculpture.json
{
"globals": {
"title": "Beyond Technology - beyond the visible world"
},
"resources": [
"/bootstrap.min.css",
"/about.min.css",
"/util.min.js"
],
"plugins": [
"resources"
]
}
globals: global ejs variables accessible via globals.<name>
Example:
<title><%= globals.title %></title>
plugins: plugin namespace of registered plugins <%- plugins.<name>.<export> %>
Example:
<%- plugins.resources.enqueue('css'); %>
</head>
The following structure is currently required
> project
|-- sculpture.json
|-- dist
| |-- libraryA.js
| |-- frameworkB.min.css
|-- pages
| |-- page1.ejs
| |-- page2.ejs
| |-- pageN.ejs
|-- templates
| |-- header.ejs
| |-- footer.ejs
$ sculpture update
[config] ~ sculpture configuration loaded
[sculpture.js]~ generating static pages..
[generator] ~ initializing plugins..
[plugins] ~ loading plugin [ resources ]
[resources] ~ generating resource hashes..
[plugins] ~ loading plugin [ moment ]
[plugins] ~ loading plugin [ cryptex ]
[generator] ~ processing 3 pages..
[ejs-renderer]~ rendering page [ contact.ejs ]
[ejs-renderer]~ rendering page [ imprint.ejs ]
[ejs-renderer]~ rendering page [ privacy-policy.ejs ]
[sculpture.js]~ finished in 2 seconds
sculpture.js is OpenSource and licensed under the Terms of Mozilla Public License 2.0 - your're welcome to contribute