1.1.1 • Published 6 years ago

enoki-build v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

enoki-build

A simple static-site generator for Enoki sites.

Installation

npm i enoki-build

Usage

enoki-build was designed to require minimal configuration and to be compatible with any Enoki environment.

Three things are required:

  1. an exported Choo application using the enoki module
  2. a nanocontent structured directory
  3. an index.html file 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.

3. index.html

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 <script> setting the window.initialState
  • <!-- @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.

Example HTML:

<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.

CLI

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
1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago