Pi66

Home | Repos | About | Blog | Gaza

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

About | Files | Commits | Refs | License


fix: simplify reload()

Author: pi66
Date: 2026-07-03 19:44
commit: 0abf12ac

Stat

M src/watcher.py 7 +3 -4

Diff

diff --git a/src/watcher.py b/src/watcher.py
index d62b98d..c3e2127 100644
--- a/src/watcher.py
+++ b/src/watcher.py
@@ -19,11 +19,10 @@ def reload(changed_path, tree_config, extras_config):
             return None
 
         md_relpath = path.relpath(current_md_file, tree_config.markdown)
-        dest = path.join(tree_config.dest, md_relpath)
-        dest = dest.removesuffix(".md") + ".html"
-        url = path.relpath(dest, tree_config.dest)
+        html = path.splitext(md_relpath)[0] + ".html"
+        dest = path.join(tree_config.dest, html)
         compile_md_to_html(current_md_file, dest, tree_config, extras_config)
-        return url
+        return html
     except Exception as e:
         warn(str(e))
 

// Created by Pi66

// Copyright ©Pi66 2026