Pi66

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

← back to log

feat: add on_page_skip hook for skipped pages

author: pi66
date: 2026-07-18 00:38
hash: 2a44635f06c81b922655c3442ca3b8c85a3b4a41

Diffstat:

M

src/build.py
1 ++++++++++++++++++++++++++++++

M

src/hooks.py
1 ++++++++++++++++++++++++++++++
 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 6063035..f95bbf5 100644
--- a/src/build.py
+++ b/src/build.py
@@ -186,6 +186,7 @@ def compile_file(md_file, html_dest, config=None, plugins=None, force:bool = Fal
     if config and not force:
         hash = handle_hash_sync(config, md_file)
         if  hash is None and path.exists(html_dest):
+            hook_call("on_page_skip", md_file)
             info(f"Skipping {GRAY(md_file)}...")
             return None 

diff --git a/src/hooks.py b/src/hooks.py
index 1c8f15c..050bde9 100644
--- a/src/hooks.py
+++ b/src/hooks.py
@@ -6,6 +6,7 @@ hooks = {
     "on_config_load"            : None,
     "on_escape_code"            : None,
     "on_file_changed"           : None,
+    "on_page_skip"              : None,
     "on_hash_check"             : None,
     "on_hash_written"           : None,
     "on_highlight_config"       : None,