GitXplorerGitXplorer
l

static-scaffold

public
2 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
2689b0016549cac808e4271fe53480293ad6b810

add .editorconfig && add .jshintrc

llisposter committed 10 years ago
Unverified
217e10472253b0c3f34962d451ab5ea7349899cf

use gulp-load-plugins

llisposter committed 10 years ago
Unverified
7b9442f642e68bd7b85946f7e227cef172f50324

remove gulp-rimraf

llisposter committed 10 years ago
Unverified
e36bf749724d33c020e7fa15f61a355e5b761706

set livereload for views changed

llisposter committed 10 years ago
Unverified
6dde0cb5468871390ce61660a51c3c99dba808e4

fix less path

llisposter committed 10 years ago
Unverified
75e8969d203dccc55d8ba57f22ed7c22b621ad72

fix livereload

llisposter committed 10 years ago

README

The README file for this repository.

static-scaffold

a scaffold for develop and build static website fast.

Features

  • 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...

Install

$ npm i -g static-scaffold

Init Proj

$ scaffold demo

Usage

Preview && develop

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

Build

$ gulp  build

This command will build static website into ./dist dir.

Currently in dev now. :)

How it works

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:

local server:

We use koa and some middlewares to build our http server, so we perfectly don't need nginx or apache.

html:

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

js:

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)

css:

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:

others files in src/assets will serverd by koa-static in live , and copied into dist/assets when builc

compress:

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.