Generating index with template.js