sydjs: static site generators

16
Static is not a dirty word SydJS, 2013.10.23 / Ben Buchanan / @200okpublic weblog.200ok.com.au

Upload: ben-buchanan

Post on 11-Jul-2015

1.449 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Sydjs: static site generators

Static is not a dirty wordSydJS, 2013.10.23 / Ben Buchanan / @200okpublic

weblog.200ok.com.au

Page 2: Sydjs: static site generators

That's static websites.

You can argue about types (again) later.

Page 3: Sydjs: static site generators

"Why are you making a static site?! That's a bit old school isn't it?"

Page 4: Sydjs: static site generators

Everything old is new again.

Page 5: Sydjs: static site generators

Good use cases

● Small/medium sites● Blogs● Version-specific or bundled documentation

Page 6: Sydjs: static site generators

Use case: UI library

● Build it with its own templates● Docs and demos● Test pages

● Include docs in repo● pull requests can include code, tests and docs

● Versioned docs deployed at release

Page 7: Sydjs: static site generators

Bad use cases

● Anything else :-P● Things that actually should be an app.

Page 8: Sydjs: static site generators

Upsides of static

● Fast● Less moving parts (in prod)● Deploy anywhere

Page 9: Sydjs: static site generators

Downsides

● Dynamic content means oldschool scripting● "It just seems too simple."

Page 10: Sydjs: static site generators

"It just seems too simple."

Page 11: Sydjs: static site generators

...and anyway, "simple":

Page 12: Sydjs: static site generators

A few nodejs options

● Hexo*● Romulus*● Blacksmith, CabinJS, DocPad, Wintersmith... ● See modernstatic.com for a list

* As seen in JS Weekly ;)

Page 13: Sydjs: static site generators

Goes a liddle sumthin like this

● npm install -g name● name scaffold dirname && cd dirname● name generate● name server● name deploy

Page 14: Sydjs: static site generators

Look for...

● Clear setup, dev/test and deploy phases● Documentation● Your preference for:

● Templates● Preprocessors● Deployment options

● Proof of life (beware abandonware)

Page 15: Sydjs: static site generators

Example activity checkBlacksmith CabinJS Docpad Hexo Romulus Wintersmith

Age 2 years 5 months 2 years 1 year 1 year 2 years

Version 1.1.3 0.3.1 6.53.4 2.2.1 0.1.1 2.0.7

Active 3 months 1 week 2 weeks 1 week 5 months 2 weeks

PRs ~100 ~100 ~700 ~300 2 ~200

Forks 31 14 143 184 4 137

Watchers 49 10 98 86 20 61

Stars 450 115 1619 1145 156 1090

License MIT MIT MIT MIT MIT MIT

(collected 2013.10.19)

Page 16: Sydjs: static site generators

Static sites have their place.Embrace simple.