]> git.za3k.com Git - blog.git/commitdiff
Fix multiple config loading order
authorZachary Vance <za3k@za3k.com>
Sat, 10 Aug 2024 00:15:30 +0000 (20:15 -0400)
committerZachary Vance <za3k@za3k.com>
Sat, 10 Aug 2024 00:15:30 +0000 (20:15 -0400)
blog

diff --git a/blog b/blog
index 0c89d83bf7f53a49549a68d3076bacf1d206e3a7..8c324830782b2d2d8557631f8be1b7d67933e973 100755 (executable)
--- a/blog
+++ b/blog
@@ -330,13 +330,15 @@ class Blog(PseudoMap):
         self.now = datetime.datetime.now(datetime.timezone.utc)
         self.now_rfc822 = self.now.strftime(RFC822)
 
-        for config in configs:
-            self.load_config(os.path.abspath(config))
+        self.load_configs([os.path.abspath(config) for config in configs])
         self.load_posts()
 
-    def load_config(self, path):
-        with open(path) as f:
-            config = yaml.safe_load(f)
+    def load_configs(self, paths):
+        config = {}
+        for path in paths:
+            with open(path) as f:
+                for k, v in yaml.safe_load(f).items():
+                    config[k] = v
 
         for k in {"source", "destination"}:
             self[k] = os.path.expanduser(config.pop(k))