mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Resave the pagedata if it has been changed by the preprocessors
This commit is contained in:
parent
6c5c11562a
commit
8788b89ce5
1 changed files with 7 additions and 0 deletions
|
@ -139,6 +139,10 @@ register_module([
|
|||
else
|
||||
$pageindex->$page->lasteditor = utf8_encode("anonymous");
|
||||
|
||||
// A hack to resave the pagedata if the preprocessors have
|
||||
// changed it. We need this because the preprocessors *must*
|
||||
// run _after_ the pageindex has been updated.
|
||||
$pagedata_orig = $pagedata;
|
||||
|
||||
// Execute all the preprocessors
|
||||
foreach($save_preprocessors as $func)
|
||||
|
@ -146,6 +150,9 @@ register_module([
|
|||
$func($pageindex->$page, $pagedata);
|
||||
}
|
||||
|
||||
if($pagedata !== $pagedata_orig)
|
||||
file_put_contents("$env->page.md", $pagedata);
|
||||
|
||||
|
||||
file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
||||
|
||||
|
|
Loading…
Reference in a new issue