Fix unreachable index page and duplicate homepage entry in navigation

buildUrl() hardcoded 'index' as the homepage, so the menu link for
index.md pointed at /nl. With a different default_page that root URL
served another page, making index.md unreachable.

- Add getEffectiveDefaultPage(): resolves 'auto' to the detected page
  and caches the result
- buildUrl() now omits the page segment only for the effective default
  page instead of the literal string 'index'
- Route getPage(), generateBreadcrumb(), getContentType() and the
  render() template data (default_page, homepage, is_homepage,
  home_active_class, current_page, lang switch URLs) through it
- getHomepageTitle() returns t('home') so the home button no longer
  duplicates a menu item label
- Drop the now-redundant default_page skip in renderMenu() so every
  page stays reachable from the menu
- getAllContentDirs() also skips dot-directories (.git) in the move
  dropdown
This commit is contained in:
2026-07-28 16:09:44 +02:00
parent 842046ac82
commit 8fdbabf587
2 changed files with 36 additions and 29 deletions
+3 -2
View File
@@ -1675,8 +1675,9 @@ function getAllContentDirs(string $contentDir, string $realContentDir): array
if (strpos($realPath, $realContentDir) !== 0) continue;
$relative = substr($realPath, strlen($realContentDir) + 1);
if ($relative === false || $relative === '') continue;
// Skip hidden directories (starting with -)
if (strpos(basename($relative), '-') === 0) continue;
// Skip hidden directories (starting with - or .)
$base = basename($relative);
if ($base[0] === '-' || $base[0] === '.') continue;
$dirs[] = $relative;
}