create-static
Create static HTML pages with ESNext, SCSS and Nunjucks.
Last updated 2 years ago by dmitri .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install create-static 
SYNC missed versions from official npm registry.

create-static

Create static html pages with ESNext, SCSS and Nunjucks.

Install

npm i create-static --save-dev

Usage

CLI

Usage: create-static -s ./path/to/src -o ./path/to/dist

Options:
  --source, -s   path to source folder containing all promo folders
  --output, -o   path to dist folder with resulted builds
  --help, -h     print help
  --version, -v  print version

Code

const createStatic = require('create-static');
const source = './path/to/src';
const output = './path/to/dist';

createStatic.run({ source, output })
  .then(() => {
    console.log('Success!');
  })
  .catch(err => {
    console.log(err);
  });

Source structure

Every folder in source folder should have following structure:

  • index.html - required, html powered by nunjucks template engine
  • content.yml - optional, data to render inside html
  • index.js - optional, javascript powered by browserify and babelify (uses es2015 and stage-0 presets)
  • indes.scss - optional, css powered by node-sass
  • assets - optional folder to store all static files (it will be copied into build)
.
|____dist
|____src
| |____page-1
| | |____index.html # required
| | |____index.js
| | |____index.scss
| |____page-2
| | |____assets
| | | |____icon.png
| | | |____some-webfont.woff
| | |____index.html # required
| | |____index.scss
| |____page-3
| | |____content.yml
| | |____index.html # required
| | |____index.scss
# as many folders as you want...
create-static -s ./src -o ./dist
# will output all ready to use files in `dist` folder

MIT Licensed

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 3
Dependencies (15)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |