Pi66

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

← back to log

refactor: remove index.html fallback for directory change events

author: pi66
date: 2026-07-03 19:46
hash: ac8004eb3f367f0fe483612b3e0e95b4e3719e09

Diffstat:

M

src/watcher.py
6 ------------------------------
 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/watcher.py b/src/watcher.py
index c3e2127..12f0b26 100644
--- a/src/watcher.py
+++ b/src/watcher.py
@@ -33,9 +33,6 @@ def watch_files(tree_config, extra_config, reload_func:Callable | None=None):
         def on_modified(self, event):
             reload_path = event.src_path
             if event.is_directory :
-                if path.exists(path.join(event.src_path, "index.html")):
-                    reload_path = path.join(event.src_path, "index.html")
-                else: 
                     return
             now = time.time()
             last = last_reload.get(reload_path, 0)
@@ -44,9 +41,6 @@ def watch_files(tree_config, extra_config, reload_func:Callable | None=None):
             last_reload[reload_path] = now
             file = reload( reload_path, tree_config, extra_config)
             if reload_func and file: reload_func(file)
-
-
-
     observer = Observer()
     handler = ReloadHandler()
     for file in [tree_config.markdown, tree_config.templates, tree_config.plugins, tree_config.static]: