A simple static-site generator for Enoki sites.
npm i enoki-build
enoki-build was designed to require minimal configuration and to be compatible with any Enoki environment.
Three things are required:
- an exported Choo application using the
index.htmlfile that provides the base
1. The App
For the best experience, I'd recommend using
@kodedninja/enoki, instead of the official package, as this contains optimalizations for pre-rendered sites.
enoki-build doesn't include bundles or does any magic, but only replaces the following:
<!-- @content -->― with the HTML output of the app
<!-- @state -->― with a
<!-- @title -->― with the title of the current page
For a simple static site, don't include the
@head part and do not load the bundle script.
<html> <head> <title><!-- @title --></title> <!-- @state --> </head> <body> <!-- @content --> <script src="/bundle.js"></script> </body> </html>
You can check out my personal site as an example.
usage enoki-build [opts] [directories to copy] options --app, -a <path> the file where the choo app's exported (./index.js) --content, -c <path> content directory (./content) --help, -h show this help text --index, -i <path> path of the index.html (./index.html) --output, -o <dir> output directory (./public) --sitemap <url> generate sitemap.xml with base url --version, -v print version examples start build $ enoki-build start build with different content folder and index $ enoki-build --content ../content --index ./random/index.html define directories to copy to the output $ enoki-build assets ../bundles