wukong v0.12.3
Wukong 悟空](https://travis-ci.org/fundon/wukong)
Next-gen for pluggable Static Site Generator, using generators via co and co-ware.
Koa and Metalsmith inspired.
In Wukong (likes in Metalsmith)
Wukong(__dirname)
// files's middlewares
.use(function *(next) {
tihs.files = this.files
.filter(function (v) {
return v === 'index';
});
yield next;
}, 'before')
// file's middlewares
.use(function *(next) {
var file = this.file;
file.contents = myth(file.contents);
yield next;
})
.build();
APIs
File
{
path: {String},
mode: {Number}, // oct
contents: {String},
metadata: {Object},
buffer: {Buffer}
...
}
Files
Before
[ 'wukong.js', 'reset.css', ... ]
After
[ File, File, ... ]
createFile()
Create a File instance.
use(*plugin, type)
Add a middleware for the file
object.
type
: before/after
build(*callback)
Start to build files.
run(file, files, *callback)
Run a set of file
, files
through the middleware stack
metadata(metadata)
Get/set metadata.
site(path)
Get/set site.
source(path)
Get/set source.
destination(path)
Get/set destination.
join(path...)
Join the current dir
Plugins
License
MIT
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago