From df7adaf0e067802daf3e83935cf9140fb15ca17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Tue, 20 Aug 2019 15:04:29 +0200 Subject: [PATCH] when building links, skip both, /custom_domain/ and --- src/template_utils.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/template_utils.rs b/src/template_utils.rs index 6c034d15..db935ab6 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -389,7 +389,10 @@ macro_rules! url { $($common_args = $common_args,)* $($custom_args = $custom_args,)* ); - let path = origin.segments().skip(1).map(|seg| format!("/{}", seg)).collect::(); //first segment is domain, drop it + let path = origin + .segments() // first segment is /custom_domain, + .skip(2)// second is , drop both + .map(|seg| format!("/{}", seg)).collect::(); let query = origin.query().map(|q| format!("?{}", q)).unwrap_or_default(); format!("https://{}{}{}", &domain, path, query) } else {