Skip to content

Commit bf930dd

Browse files
authored
fix: hash plugins config to trigger page rebuilds (#387)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
1 parent b93d630 commit bf930dd

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

crates/zensical/src/config/project.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ pub struct Project {
9191
pub nav: Vec<NavigationItem>,
9292
/// Template hash.
9393
pub template_hash: u64,
94+
/// Plugins hash.
95+
pub plugins_hash: u64,
9496
/// Source files.
9597
pub source_files: Vec<(PathBuf, u64)>,
9698
}

python/zensical/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,14 @@ def _apply_defaults(config: dict, path: str) -> dict:
455455

456456
# Hash all templates, so we rebuild if something changes
457457
config["template_hash"] = _hash(_list_templates(config))
458+
459+
# Hash the entire plugins configuration.
460+
# This is a special case for plugins because we currently only source
461+
# the plugin configuration that we support in Rust,
462+
# which means config on other plugins doesn't contribute to the hash,
463+
# in turn not triggering full rebuilds.
464+
config["plugins_hash"] = _hash(config["plugins"])
465+
458466
return config
459467

460468

0 commit comments

Comments
 (0)