Hikaru
A static site generator that generates routes based on directories naturally.
Install
# npm i -g hikaru-coffee
Code Structure
Router:
- Load each post then compile template and cache and render then call generator then save.
- Load each asset then render then save.
- Load each page then compile template and cache and render then call generator then save.
- Make custom site variables before pages and posts are generated.
Renderer: Register srcExt, docExt and fn, render data and return a promise of data.
Generator: Receive page(data), posts and ctx then return a promise of data.
TODO List
Dir Structure
hikura-site/
|- src/ # source dir for user files
| |- images/
| |- css/
| |- js/
| |- index.md
| |- about/
| | |- index.md
| |- tags/
| | |- index.md
|- doc/ # source will be render to here
| |- images/
| | |- logo.png
| |- css/
| | |- index.css
| |- js/
| | |- index.js
| |- index.html
| |- 2.html # page 2 of index
| |- 3.html # page 3 of index
| |- about/
| | |- index.html
| |- tags/
| | |- index.html # layout: tags
| | |- tag-1/
| | | |- index.html # automatically generated, layout: tag
| | | |- 2.html # page 2 of tag-1
|- themes/
| |- aria/
| | |- src/ # this will be render to doc/
| | | |- layout.njk # templates
| | | |- index.njk
| | | |- tags.njk
| | | |- tag.njk
| | | |- page.njk # if no layout specific, fallback to this
| | | |- css/
| | | | |- index.styl
| | | |- js/
| | | | |- index.js
| | | |- images/
| | | | |- logo.png
| |- README.md