Next-gen for pluggable Static Site Generator, using generators via co and co-ware.
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();
{
path: {String},
mode: {Number}, // oct
contents: {String},
metadata: {Object},
buffer: {Buffer}
...
}
Files
[ 'wukong.js', 'reset.css', ... ]
[ File, File, ... ]
Create a File instance.
Add a middleware for the file
object.
type
: before/after
Start to build files.
Run a set of file
, files
through the middleware stack
Get/set metadata.
Get/set site.
Get/set source.
Get/set destination.
Join the current dir
MIT