summary history branches tags files
commit:a99f2a72a3bfc09be4d8b0e8dd1cea12837403af
author:Trevor Bentley
committer:Trevor Bentley
date:Tue Jan 14 23:50:40 2025 +0100
parents:0c3c1f7d4a2ab8e36f9c09d68c72eb0477f158e1
strip trailing / from site URL
diff --git a/src/generate.rs b/src/generate.rs
line changes: +4/-0
index d319423..e6826f6
--- a/src/generate.rs
+++ b/src/generate.rs
@@ -112,6 +112,10 @@ impl GitsyGenerator {
             ctx.insert("site_name", site_name);
         }
         if let Some(site_url) = &self.settings.site_url {
+            let site_url = match site_url.chars().last() {
+                Some('/') => &site_url[0..site_url.len() - 1],
+                _ => site_url,
+            };
             ctx.insert("site_url", site_url);
         }
         if let Some(site_description) = &self.settings.site_description {