diff --git a/libs/functions.php b/libs/functions.php index c65fafc..9f1e02b 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -73,7 +73,7 @@ function directory_tree($dir, $ignore) { global $base_doc, $multilanguage, $output_language; $tree = array(); - $Item = array_diff(scandir($dir), array(".", "..", "index.md")); + $Item = array_diff(scandir($dir), array(".", "..")); foreach ($Item as $key => $value) { if (is_dir($dir . '/' . $value)) { if (!in_array($value, $ignore['folders'])) @@ -115,7 +115,13 @@ $return .= ""; + $link = "#"; + $nav_class = "aj-nav "; + if(in_array("index.md", $node)) { + $link = $t . clean_url($key, $mode); + $nav_class = ""; + } + $return .= ""; $return .= clean_url($key, "Title"); $return .= ""; $return .= ""; $return .= ""; } - else { + else if($node !== "index.md") { $return .= " 0) $url = substr(strrchr($url, "/"), 1); + $parts = array_reverse(explode('/', $url)); + if (isset($parts[0])) { + if ($parts[0] === "index.md" && isset($parts[1])) $url = $parts[1]; + else $url = $parts[0]; + } $url = explode('_', $url); if (isset($url[0]) && is_numeric($url[0])) unset($url[0]); if ($mode === 'Filename') $url = implode('_', $url); diff --git a/libs/live.php b/libs/live.php index b5546f6..7eb4e31 100644 --- a/libs/live.php +++ b/libs/live.php @@ -51,6 +51,7 @@ $file .= '/' . $dirs[$key]; $tree = $tree[$dirs[$key]]; } + if (is_file($file . "/index.md")) $file = $file . "/index.md"; return $file; } }