generators: Tweak TemplatePagesGenerator to expand template content

This allow you to use |filename| linking in your template pages (but
not in the direct templates living in the theme).