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
- Host: GitHub
- URL: https://github.com/kodedninja/enoki-build
- Owner: kodedninja
- Created: 2019-05-02T20:16:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T14:31:46.000Z (almost 7 years ago)
- Last Synced: 2025-01-02T22:30:13.369Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
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">