summary history branches tags files
commit:42870f1c77564bb8b3240e9475998d575b39a232
author:Trevor Bentley
committer:Trevor Bentley
date:Sun Jan 15 02:30:13 2023 +0100
parents:16f56617a4c38ce87b9a721a70eaaab9029780cf
don't generate asset folder if not used
diff --git a/src/generate.rs b/src/generate.rs
line changes: +6/-2
index d71ada6..4e6bf48
--- a/src/generate.rs
+++ b/src/generate.rs
@@ -363,7 +363,9 @@ impl GitsyGenerator {
                 local_ctx.insert("site_description", site_description);
             }
             local_ctx.insert("site_dir", &self.settings.outputs.output_dir());
-            local_ctx.insert("site_assets", &self.settings.outputs.to_relative(&self.settings.outputs.global_assets(None, None)));
+            if self.settings.outputs.global_assets.is_some() {
+                local_ctx.insert("site_assets", &self.settings.outputs.to_relative(&self.settings.outputs.global_assets(None, None)));
+            }
             local_ctx.insert("site_generated_ts", &generated_dt.timestamp());
             local_ctx.insert("site_generated_offset", &generated_dt.offset().local_minus_utc());
 
@@ -686,7 +688,9 @@ impl GitsyGenerator {
             global_ctx.insert("site_description", site_description);
         }
         global_ctx.insert("site_dir", &self.settings.outputs.output_dir());
-        global_ctx.insert("site_assets", &self.settings.outputs.to_relative(&self.settings.outputs.global_assets(None, None)));
+        if self.settings.outputs.global_assets.is_some() {
+            global_ctx.insert("site_assets", &self.settings.outputs.to_relative(&self.settings.outputs.global_assets(None, None)));
+        }
         global_ctx.insert("site_generated_ts", &generated_dt.timestamp());
         global_ctx.insert("site_generated_offset", &generated_dt.offset().local_minus_utc());