Always include nav.html
This commit is contained in:
parent
89d5cccc31
commit
2cade060cf
@ -22,6 +22,7 @@ function generateNavigation(): string
|
||||
global $routerConfig;
|
||||
global $routerRequest;
|
||||
|
||||
$nav = file_get_contents($routerConfig["template_dir"] . "nav.html");
|
||||
$site_dirs = array_diff(scandir($routerConfig["page_dir"]), array('.', '..'));
|
||||
|
||||
$nav_out = "";
|
||||
@ -92,7 +93,7 @@ function generateNavigation(): string
|
||||
}
|
||||
}
|
||||
|
||||
return $nav_out;
|
||||
return str_replace("__NAV_PAGES__", $nav_out, $nav);
|
||||
}
|
||||
|
||||
function getNavigationEndpoint() :array{
|
||||
|
@ -127,7 +127,7 @@ function getPage($page_name_in = null, $site_name_in = null): string
|
||||
global $routerConfig;
|
||||
|
||||
$skeleton = file_get_contents($routerConfig["template_dir"] . "skeleton.html");
|
||||
$nav = file_get_contents($routerConfig["template_dir"] . "nav.html");
|
||||
|
||||
if(!empty($pageMetadata["parameters"]["page_title"])){
|
||||
$page_title = $pageMetadata["parameters"]["page_title"];
|
||||
}
|
||||
@ -141,12 +141,11 @@ function getPage($page_name_in = null, $site_name_in = null): string
|
||||
"currentTitle" => $page_title,
|
||||
"defaultPage" => $routerConfig["default_page"],
|
||||
]);
|
||||
|
||||
$navpages = generateNavigation();
|
||||
|
||||
$nav = str_replace("__NAV_PAGES__", $navpages, $nav);
|
||||
|
||||
$out = $skeleton;
|
||||
$out = str_replace("__TEMPLATE__NAV__", $nav, $out);
|
||||
$out = str_replace("__TEMPLATE__NAV__", $navpages, $out);
|
||||
$out = str_replace("__TEMPLATE__PAGE__", $page, $out);
|
||||
$out = str_replace("__TEMPLATE__DYNASCRIPT__", $dynamic_script, $out);
|
||||
$out = str_replace("__TEMPLATE__DYNASTYLE__", $dynamic_style, $out);
|
||||
|
Loading…
Reference in New Issue
Block a user