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