A static site generator.
Install
$ yarn add -D diz gulp$ npm i -D diz gulp
Example
Diz;
File organization
The directory at the level one level below root path is recognized as root. However, in order to be processed, it is necessary to put config.js directly under the root directory.
└─ <base path>
│ // blog1 is processed
├─ <blog1>
│ ├─ 0_getting-started.md
│ ├─ 1_hello-world.md
│ ├─ n_***.md
│ ├─ config.js
│
│ // blog2 isn't processed because there is no config.js
├─ <blog2>
│ ├─ 0_getting-started.md
│ ├─ 1_hello-world.md
│ ├─ n_***.md
├─ <...>
In config.js
, describe meta information about the site, theme information, compilation method and so on. Also, the string up to _
in each .md file is removed. It just uses to adjust the order of post files.
For example, it will be like this.
const Renderer = ;const Plugin = ;const marked = ; moduleexports = //* required title: 'blog title' url: 'http://blog.com/' //* option description: 'blog description' author: 'nju33' //* option // Whether to reverse the order of n_*.md files reverse: false //* option // When parent directory name is specified, // the following happens // // 1. Inherit config.js of the specified directory // 2. Becomes part of the blog of the specified directory // parent: '...' //* option // Overwrite inherited config override: ... //* required theme: //* required // The theme itself (.jsx etc) Renderer //* option // Theme's config config: {} //* option // Md file conversion function // (contents: string): string compile: marked //* option // Array of used plugins plugins: ;
The config data changes depending on the plugin and theme you are using.
CLI
diz generate id
Generate urn iddiz generate date
Generate just date
Themes
How to create a theme
- Install diz-theme
- use it in parent class (e.g.)
class extends DizTheme
For more information, click here
Plugins
- collection page generatorCreate a list pages
- atom feedCreate atom feed
- refOverride post.url
License
The MIT License (MIT)
Copyright (c) 2016 nju33 nju33.ki@gmail.com