diff --git a/index.php b/index.php index 2ea256c..a0221a0 100644 --- a/index.php +++ b/index.php @@ -52,7 +52,9 @@ else{ $page = file_get_contents($template_dir . "404.html"); } -$nav = str_replace("href=\"/$page_name\"", "href=\"/$page_name\" class=\"active\"", $nav); +$navpages = include_once $template_dir . "navpages.php"; + +$nav = str_replace("__NAV_PAGES__", $navpages, $nav); $out = $skeleton; $out = str_replace("__TEMPLATE__NAV__", $nav, $out); diff --git a/templates/nav.html b/templates/nav.html index 06cc4ac..2be64f0 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,8 +1,6 @@ \ No newline at end of file diff --git a/templates/navpages.php b/templates/navpages.php new file mode 100644 index 0000000..8dd3c3a --- /dev/null +++ b/templates/navpages.php @@ -0,0 +1,14 @@ +__NAME__'; + +$page_dir = "/pages"; + +$files1 = scandir($page_dir); + +echo $files1; + +return ob_get_clean(); + +?> \ No newline at end of file