Pi66

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

← back to log

fix: treat tree.plugins as a directory

author: pi66
date: 2026-07-15 00:10
hash: bb70c99a39bd872d91c840569d61b952fae9064b

Diffstat:

M

src/fileops.py
2 ++++++------

M

src/init_project.py
5 ++++++++++++++++++------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/src/fileops.py b/src/fileops.py
index 59ee1c2..396870f 100644
--- a/src/fileops.py
+++ b/src/fileops.py
@@ -29,4 +29,4 @@ def create_tree_dirs (tree:Tree) -> None:
     makedirs(tree.static   , exist_ok=True)
     makedirs(tree.templates, exist_ok=True)
     makedirs(tree.dest     , exist_ok=True)
-    makedirs(path.dirname(tree.plugins) ,exist_ok=True)
+    makedirs(tree.plugins  , exist_ok=True)
diff --git a/src/init_project.py b/src/init_project.py
index 36c3529..62f3ba9 100644
--- a/src/init_project.py
+++ b/src/init_project.py
@@ -19,7 +19,7 @@ def init_config_struct(project_name:str) -> Config:
             static    = "src/static",
             templates = "src/templates",
             dest      = "src/dest",
-            plugins   = "src/plugins.py",
+            plugins   = "src/plugins",
         ),
         webview = Webview(
             host        = "localhost",
@@ -79,7 +79,8 @@ def write_default_content(tree:Tree) -> None:
     css_file = path.join(tree.static, "style.css")
     write_file(css_file,CSS_CONTENT )

-    write_file(tree.plugins,PLUGINS_CONTENT )
+    plugins_file = path.join(tree.plugins, "main.py")
+    write_file(plugins_file,PLUGINS_CONTENT )

 def write_config_file(project_path, config_content):
     makedirs(project_path, exist_ok=True)