xinglinkedinenvelopebubblesgoogleplusfacebooktwitterfeedgithub

Boilerplate for static site generation

25th March 2014 | by Adam Beres-Deak | static website, boilerplate

As I already mentioned before, I really like simple things like static webpages. To speed things up, I created a boilerplate, which can be used by anybody to generate static websites.

This blog is also statically generated. Statically generating websites has many advantages. Some of these are

  1. These sites can be hosted everywhere
  2. No backend to be hacked
  3. Outstanding performance
  4. etc.

The boilerplate code can be found on GitHub: bdadam/static-site-boilerplate

What can this boilerplate do for you?

  1. It generates html from markdown files with the help of Assemble.
  2. It generates minified and optimized css file(s) with less and uncss
  3. It generates minified and optimized JavaScript files with RequireJS
  4. During development the affected files are regenerated when something changes (GruntJS watch task)
  5. Local webserver with Livereload to immediately see what changes and what does it look like

How to use it?

  1. Clone this repository git clone https://github.com/bdadam/static-site-boilerplate
  2. Install node dependencies npm install
  3. Install bower dependencies bower install
  4. Simply run grunt build to see that everything works
  5. Run grunt for starting "development mode"
  6. Then edit some files in the content folder and watch the html being regenerated and automatically refreshed in the browser

What is planned for future releases?

  1. Automatically running JavaScript unit tests with Jasmine
  2. Supporting browserify for building JavaScript files
  3. Adding some Handlebars helpers
  4. Maybe some more partials and templates
  5. Some real examples where you can see it in action

I would be glad to hear your feedback in the comments.

by Adam Beres-Deak

| Share | Tweet | Share | Share

Latest blog posts

Displaying icons with custom elements 14th October 2015

Plain JavaScript event delegation 26th January 2015

After the first year of blogging - what happened on my blog in 2014? 1st January 2015

Better webfont loading with using localStorage and providing WOFF2 support 18th December 2014

Worth watching: Douglas Crockford speaking about the new good parts of JavaScript in 2014 20th October 2014