![](./image/pug-sample.png)
![](./image/pug.png)
![](./image/stylus-sample.png)
![](./image/stylus.png)
![](./image/es6-sample.png)
![](./image/es6.png)
Code less, Review quick, Get productive by
![](./image/pug.png)
![](./image/stylus.png)
![](./image/es6.png)
Get started
$ npm install -g sssg
$ cd [work folder]
$ sssg try
See more detail for installation.
Overview
SSSG(Simple Static Site Generator) is a super-lightweight framework for composing static website with live preview.
Don't forget what you start creating. You create your website, not gulp tasks.
Many people creates similar gulp tasks everywhere for developing static website. By SSSG, you don't need to spend your time debugging gulp, instead you should crash your head for what you are truly creating.
The purposes for this framework are:
- to code less and proactive with Pug, Stylus, ES6 Javascript.
- to preview web page on coding. (WYSIWYG)
- to generate portable static web files.
I originally wanted prototyping tool for website and found some wireframing services.
Those services are useful in that users don't need to code anything to outline site design.
However, as a programmer myself,
I needed CODE to spec out web designs.
By the reason above, this framework is targeting coders who want to share prototype design
based on text.
Simple = The rest is yours
SSSG does only simple tasks.
In summary, it
- compiles
*.pug
in source folder into*.html
in destination folder. -
compiles
main.styl
in source folder intomain.css
in destination folder. - compiles
main.js
in source folder intomain.js
in destination folder. - copies image files and other misc files into destination folder.
![](./image/sssg-build-image.png)
This is so simple, isn't it? Actually SSSG is not a framework but kind of a convention of folder structure.
SSSG itself does just a few things. It relies on some useful npm modules such as gulp, babel and so on.
You even do not need SSSG and write your own task to generate static web site with gulp. However, to generate static website with gulp task, everyone will write similar codes everywhere.
I believe I could save many of your time by SSSG, which is a collection of common gulp tasks for static websites.
Believe my sense and you will spare your time handsomely.
While SSSG does just simple works, you can fully take advantages of pug/stylus/es6 features without concerns.
![](./image/pug.png)
Pug is equipped with code templating system. If your website utilizes the same layout over several pages,
you should split the pages into static components(sidebar, header, footer, etc) and variable contents.
Pug encourages you to do so.
Anyway, how you structure your website components is up to you.
![](./image/stylus.png)
Haven't you ever heard DRY coding? If no, you've got a chance to learn it. As well as Pug,
Stylus makes you code less, by representing parent-child relationship as an indent.
To fully speed up coding, you should try IDE that supports Stylus.
Additionally, Stylus also supports modular system. It can import
any other stylus files.
You can construct your own modular structure as clean as you feel comfortable.
Of course, you can write all style information only in main.styl
.
![](./image/es6.png)
Unlike Pug/Stylus, ES6 itself is not equipped with DRY syntax.
But it has asynchronous system with Promise
, native class
support,
and like Stylus, import
statement.
With class
and import
feature, you can fully modularize your front-end
business logic into reusable and structured framework.
Be notified that SSSG adopts babel, meaning you can use ReactJS/JSX to write SPA by custom .babelrc.
Get detail in Build Mechanism.
Try it out
Requirements
You need to have
NodeJS 6.x
installed on your computer.
Check out official installation manual for details.
* For Windows Users.
Global npm modules location %AppData%\npm
must be added to PATH environment variable.
Install
After you installed these requirements, install SSSG globally on your computer.
$ npm install -g sssg
Let's try
$ cd [work folder]
$ sssg try
After dispatching the command above, browser will launch and open ./docs/index.html created in your working folder.
Let's edit ./src/html/index.pug and see what happens.
Tips
You can try customizing this page by the command below.
$ sssg try --readme
Debug
![](./image/sssg-screenshot.png)
Debug your web design with element outlining by accessing http://localhost:3001
This debug feature comes from BrowserSync
![](./image/debug.png)