mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-06 09:41:14 -04:00
Merge pull request #694 from Daniel15/header-footer-basedir
Stop searching for header/footer files at web root
This commit is contained in:
commit
869f1f5cda
2 changed files with 14 additions and 1 deletions
|
@ -108,9 +108,14 @@
|
||||||
Note the different filenames: "header" (only current) - "headers" (current and sub directories)!
|
Note the different filenames: "header" (only current) - "headers" (current and sub directories)!
|
||||||
The file's content will be placed inside a <div/> tag above/below the main content.
|
The file's content will be placed inside a <div/> tag above/below the main content.
|
||||||
If a file's extension is ".md" instead of ".html" its content will be interpreted as markdown.
|
If a file's extension is ".md" instead of ".html" its content will be interpreted as markdown.
|
||||||
|
|
||||||
|
- stopSearchingAtRoot: boolean, only search for header and footer files until the web root
|
||||||
|
directory. if `false`, will search for header/footer up the entire directory structure,
|
||||||
|
even above the web root
|
||||||
*/
|
*/
|
||||||
"custom": {
|
"custom": {
|
||||||
"enabled": true
|
"enabled": true,
|
||||||
|
"stopSearchingAtRoot": true
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -54,6 +54,14 @@ class Custom {
|
||||||
if ($parent_path === $path) {
|
if ($parent_path === $path) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop once we reach the root
|
||||||
|
if (
|
||||||
|
$this->context->query_option('custom.stopSearchingAtRoot', true) &&
|
||||||
|
$path === $this->context->get_setup()->get('ROOT_PATH')
|
||||||
|
) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$path = $parent_path;
|
$path = $parent_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue