Insert middleware to provide templates with request