modify minify function to run templating on resources