diff --git a/src/template_utils.rs b/src/template_utils.rs index db935ab6..5f0e61f2 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -390,10 +390,13 @@ macro_rules! url { $($custom_args = $custom_args,)* ); let path = origin - .segments() // first segment is /custom_domain, - .skip(2)// second is , drop both + .segments() + .skip(1)// skip is part .map(|seg| format!("/{}", seg)).collect::(); - let query = origin.query().map(|q| format!("?{}", q)).unwrap_or_default(); + let query = origin.query() + .filter(|q| !q.is_empty()) + .map(|q| format!("?{}", q)) + .unwrap_or_default(); format!("https://{}{}{}", &domain, path, query) } else { $(