a scaffold for develop and build static website fast.
- fast bootstrap a static website project
- local preview(no need to config nginx or apache)
- support template engine like
jade
,swig
- supoort live-reload
- build static files(compile jade or swig templates)
- build with both gulp and grunt (in dev)
- fast deploy with ftp or other ways (in plan)
- support less, sass
- still planning...
$ npm i -g static-scaffold
$ scaffold demo
change to your 'demo' dir
$ cd demo
install node deps
$ npm i
start local server
$ node --harmony app.js
or, when you're developing, you can start a live-reload server:
$ node --harmony gulp live
visit http://localhost:8300
$ gulp build
This command will build static website into ./dist
dir.
Currently in dev now. :)
First, we defined two mode:
-
live
: which is useful when developing, it will auto reload page if any source file changed. -
build
: which is for building the final static website files.
with the default gulpfile, here are the workflows:
We use koa and some middlewares to build our http server, so we perfectly don't need nginx or apache.
live
: with jade
or swig
will be rendered instant by koa middlewares. It doesn't write file in live
.
build
: we use gulp plugins to build html files. It will generate .html files into dist
with the same dir structure in src
live
: it will be loaded just right in src
dir by koa-static
.
build
: we just copy .js files from src
to dist
(may be changed in the future)
live
: less
, sass
files will be compiled into dist
dir, and then servered by koa-static
. The vanilla css files will be servered as the other assets
files.
build
: less
, sass
files will be compiled into dist/css
dir.
others files in src/assets
will serverd by koa-static
in live
, and copied into dist/assets
when builc
everything in dist/css
and dist/js
will be compressed into a combined js or css files and be renamed with hash to fight with browser's cache.