Pi66

merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi

← back to log

refactor: rename config to tree_config in build.py for clarity

author: pi66
date: 2026-06-27 11:15
hash: 2f30734e57e76ba1385dc85d3dbc56d6202ee170

Diffstat:

M

src/build.py
8 +++++++++++++++---------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/src/build.py b/src/build.py
index 7e7c45c..03b1716 100644
--- a/src/build.py
+++ b/src/build.py
@@ -117,15 +117,15 @@ def build(building_type:str,project_path:str, file:list[str]):
         else:
             project_path = project_path if project_path else getcwd()
             find_project_from_path(project_path)
-            config  = load_tree_config(project_path)
-            md_path = config.markdown
+            tree_config  = load_tree_config(project_path)
+            md_path = tree_config.markdown

             for parent, _, files  in walk(md_path):
                 for filename in files:
                     md_file = path.join(parent, filename)
                     md_relpath = path.relpath(md_file,md_path)
-                    html_dest  = path.join(config.dest, md_relpath).removesuffix(".md") + ".html"
-                    compile_md_to_html(md_file, html_dest, config)
+                    html_dest  = path.join(tree_config.dest, md_relpath).removesuffix(".md") + ".html"
+                    compile_md_to_html(md_file, html_dest, tree_config)

     except Exception as e:
         fatal(e, f"Build failed: {e}")