lgen
0config static site generator for node.js
prepare
create a project
mkdir shiny-new-project && cd shiny-new-projectcat << EOF > package.jsonEOFnpm install lgen --save-dev
create build script
cat << EOF > Slakefile{read, markdown, jade, stylus, autoprefixer, beautify, write, find-files, cssmin} = require \lgen<-! task \buildfind-files \*.md read >> markdown! >> jade >> beautify.html! >> write \.htmlfind-files \*.styl read >> stylus >> autoprefixer! >> cssmin >> write \.cssEOF
create some source files
mkdir sourcecat << EOF > source/index.md# hey ## i'm rendered from markdown EOFcat << EOF > source/style.stylbody margin 0 auto width 960pxEOFcat << EOF > source/default.jadedoctype 5html head link title= title || basename body != contentEOF
use
slake build
roll your own build scenario
{map, flip, each} = require \prelude-ls { read, markdown, jade, copy, write, find-files, beautify, stylus, autoprefixer, livescript, cssmin, uglify-js, extend-ctx} = require \lgen write-html = beautify.html! >> write \.html task \posts -> posts = find-files "????-??-??.md" names = map (.basename), posts set-post-attrs = extend-ctx ({basename}) -> idx = names.index-of basename prev: if idx > 0 then names[idx - 1] else void next: if idx < names.length then names[idx + 1] else void posts `flip(each)` (read >> set-post-attrs >> markdown! >> jade(\post) >> write-html) task \index -> find-files \index.md read >> markdown({+pygments}) >> jade(\default) >> write-html task \static -> find-files \*.styl read >> stylus >> autoprefixer! >> cssmin >> write \.css find-files \*.ls read >> livescript >> uglify-js >> write \.js find-files \*.png copy task \build -> each invoke, <[static index posts]>