Build dynamic paths from a template.