Encode urls in templates