Generate index from template