web-tools
helps buildin a website.
npm install
This will install
npm install yargs
: read commandline argumentsnpm install gulp-cli
: the gulp commandlinenpm install gulp
: to be able to run tasks, such asgulp helloworld
npm install handlebars handlebars-wax
: handlebars / mustache for preprocessingnpm install sass gulp-sass
: css preprocessornpm install gulp-preprocess
: js preprocessornpm install gulp-rename
: rename a stream, so that the destination has a different name than the source (.hbs
to.html
for example)
Run using
npm run build -- -site-root-dir <mysite>
Default website is test-website.
This is a sample website, compiled using command npm run build
. It contains:
dist
: the result repositorysrc
: all the sources, including handlebars files, scss, js used by the website, and gulp configuration
Handlebars file, used to build html files. In order to use handlebars, you may use:
{{{WEBTOOLS_HOUR}}}
: variable to be replaced{{> footer.hbs}}
: include a partial namedpartials/footer.hbs
{{{helloworld "First line" "Second line"}}}
: run a js function, named helloworld, which is ingulp-config/handlebars-helpers.js
, to render html