Hi! I'm Nikos Roussos, Open-Source Engineer and Advocator, Digital Rights Activist, and a Free mind :)
Creative Commons License

Kickstarting a static website with ember.js and handlebars.js

posted on 20/10/2013 22:59 #opensource #webmaker #mozilla

Sometimes you want to build quickly a static website. No need for a backend or a static content generator. But you come to a point where you want to introduce some simple features and you get annoyed mostly because you have to duplicate things. You have the same footer copied on every page or you have a list of items (pages) and you wish you could have the same template for all of them and get these items serialized in some way (the only way: json).

Ember.js (which includes handlebars.js) can really come in handy in these situations. I started using it for the first time when I wanted to build a simple static website for archiving Athens Friday night bike rides, known as freeday. And since it proved to be the right choice I'm keep using it every time I want to design something similar.

So in order to minimize the time I spend kickstarting such a website, I pushed a few bits of code that can serve as a starting point. Just check the repo and see how it looks like.

PS. Of course ember.js is much more than this. If you are interested for more see this video and then dive into the documentation.