mirror of
https://github.com/zensical/zensical.git
synced 2026-05-03 17:40:31 +00:00
fix: hash plugins config to trigger page rebuilds (#387)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
committed by
GitHub
parent
b93d630c0a
commit
bf930dd84b
@@ -91,6 +91,8 @@ pub struct Project {
|
||||
pub nav: Vec<NavigationItem>,
|
||||
/// Template hash.
|
||||
pub template_hash: u64,
|
||||
/// Plugins hash.
|
||||
pub plugins_hash: u64,
|
||||
/// Source files.
|
||||
pub source_files: Vec<(PathBuf, u64)>,
|
||||
}
|
||||
|
||||
@@ -455,6 +455,14 @@ def _apply_defaults(config: dict, path: str) -> dict:
|
||||
|
||||
# Hash all templates, so we rebuild if something changes
|
||||
config["template_hash"] = _hash(_list_templates(config))
|
||||
|
||||
# Hash the entire plugins configuration.
|
||||
# This is a special case for plugins because we currently only source
|
||||
# the plugin configuration that we support in Rust,
|
||||
# which means config on other plugins doesn't contribute to the hash,
|
||||
# in turn not triggering full rebuilds.
|
||||
config["plugins_hash"] = _hash(config["plugins"])
|
||||
|
||||
return config
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user