Using templates to generate pages