An open API service indexing awesome lists of open source software.

https://github.com/kodedninja/enoki-build

A simple static-site generator for Enoki sites
https://github.com/kodedninja/enoki-build

Last synced: 13 days ago
JSON representation

A simple static-site generator for Enoki sites

Awesome Lists containing this project

README

          

# enoki-build

Stability

A simple static-site generator for [Enoki](https://enoki.site/) 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](https://github.com/choojs/choo/) application using the [`enoki`](https://npmjs.com/package/enoki) module
2. a [`nanocontent`](https://github.com/jondashkyle/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`](https://github.com/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:

- `` ― with the HTML output of the app
- `` ― with a `` 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
<html>
<head>
<title><!-- @title --></title>
<!-- @state -->
</head>
<body>
<!-- @content -->
<script src="/bundle.js">