FIX: ensure links are valid in template