add template.html and specific directory support