Back in the good old days when you asked for a web page you got a web-page. But then you wanted another page and you got another whole web page.
This was fine - if I click on a link I expect something to happen - a little spinner while something loads seems logical. But when I load a page, and the outline is there and then a spinner whirls away - that seems wrong. There was one step in requesting the page - surely I should just get the whole page! Especially when the layout moves and you thought you'd clicked on a button but in reality had accidentally liked a photo of your great aunt.
When building this blog project I wanted the speed of updating pages using scripting behind the scenes but wanted that first request to return the whole page. I decided to try out handlebars as I had heard good things and from what I could see it fitted what I wanted to do. If you've ever used a templating language then it is fairly easy to pick up. Handlebars is very minimal so lots of the functionality you would find as standard elsewhere you have to build yourself.
You can take a look at the project on github - the key part with sharing the templates between the server can be found in this section of code