Fork me on GitHub

Usage

sssg <command> [options]

sssg try [--readme] [--silent]

$ sssg try
Creating src directory to ./src
...
[Browsersync] Serving files from: docs/
Finished!

Start experiencing SSSG just now.
This will create ./src and ./docs  at your working directory.

Actually this just does sssg init and sssg serve sequentially.
Try adding code to  ./src/html/index.pug and see browser changes.
Edit styles via  ./src/css/main.styl and front-end logic via  ./src/js/main.js

--readme
Optional.
If this option is set, ./src folder is initialized with this introduction document.
If not set, the minimal set of files will be put into ./src.
--silent
Optional.
This is disabled by default.
Suppress notification on successful builds/errors.

sssg init [path]

$ sssg init
Creating src directory to ./src
Finished!

Initialize SSSG. This will make  ./src folder at your working directory and put source files (index.pug/main.styl/main.css/etc) into the folder.

path
Optional.
Default is  ./src.
Directory path to put source files into.

sssg build [--src|-s path] [--dst|-d path] [--env|-e env] [--root|-r path]

$ sssg build
[15:21:09] Active configuration: {
  "js": {
    "srcDir": "src//js",
...
[15:21:10] build:js main.js
[15:21:10] build:js 1 item
Finished!

Load source files and build it into destination folder.
This will compile pug/stylus/es6 to html/css/javascript.
Build details are described in the following page.
Build Mechanism

--src | -s path
Optional.
Default is  ./src.
Source files directory path to load
--dst | -d path
Optional.
Default is  ./dst.
Destination folder to put compiled files into
--env | -e env
Optional.
Default isproduction.
Possible value is either "development" or "production".
If "development" is specified, debugging information will be added to javascript/css files. Also all files are output in human-friendly format and not minified.
If "production" is specified, all debugging information will be cut and contents will be minified.
--root | -r path
Optional.
Default is  ./dst.
A folder which root index.html  will be output to. In most cases, you don't need to use this option.

sssg clean [--dst|-d path] [--root|-r path]

$ sssg clean
[17:13:10] Active configuration: {
  "js": {
    "srcDir": "src//js",
...
  "environment": "production"
}
Finished!

Clean output folder. This will remove all files/dirs in --dst folder.
--dst folder itself is not deleted.

--dst | -d path
Optional.
Default is  ./dst.
See here
--root | -r path
Optional.
Default is  ./dst.
See here

sssg rebuild [--src|-s path] [--dst|-d path] [--env|-e env] [--root|-r path]

$ sssg rebuild
[15:21:09] Active configuration: {
  "js": {
    "srcDir": "src//js",
...
[15:21:10] build:js main.js
[15:21:10] build:js 1 item
Finished!

Just dosssg clean and sssg build

sssg serve [--src|-s path] [--dst|-d path] [--env|-e env] [--root|-r path] [--silent]

$ sssg serve
[17:21:24] Active configuration: {
  "js": {
    "srcDir": "src//js",

...

[17:21:25] build:js 1 item
[Browsersync] Access URLs:
 ---------------------------------------
       Local: http://localhost:3000
    External: http://10.160.250.116:3000
 ---------------------------------------
          UI: http://localhost:3001
 UI External: http://10.160.250.116:3001
 ---------------------------------------
[Browsersync] Serving files from: docs/
Finished!

Serve generated contents for live preview. Update source files and page will be immediately reloaded. You can compose your website in WYSIWYG style with this command.

Options are the same as sssg build except that default value of --env is "development".

sssg package [--src|-s path] [--dst|-d path] [--env|-e env] [--root|-r path]

$ sssg package
[10:20:10] Active configuration: {
...
}
Finished!

All source css/js/image which dst html file is referencing will be merged into the html file.
You get all-in-one html file with all css/js/image file injected in one file.

Options are all the same as sssg serve .