compile templates with their local path as the key