diff --git a/lib/navigation.php b/lib/navigation.php index fe32a71..8471012 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -35,8 +35,8 @@ function generateNavigation(): string } $navpages = ""; - foreach ($pages_dir as $page_dir) { - $page_dir = explode(".", $page_dir)[0]; + foreach ($pages_dir as $page_file) { + $page_dir = explode(".", $page_file)[0]; $page_class = "class=\"navpage_link\""; if ($routerRequest["subdomain"] == $site_dir && $routerRequest["page_name"] == $page_dir) { $page_class = "class=\"navpage_link active\""; @@ -47,10 +47,24 @@ function generateNavigation(): string $page_name = str_replace("_", " ", $page_dir); $page_name = explode(".", $page_name)[0]; $page_name = ucfirst($page_name); + $page_file = $routerConfig["page_dir"] . $site_dir . "/" . $page_file ; + $page_tmp = file_get_contents($page_file); - $navpages .= "