1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-01 06:10:25 +02:00

Showing underscores in directory and file names as spaces in breadcrumbs

This commit is contained in:
til-schneider
2015-12-21 11:28:44 +01:00
parent eb95407e17
commit 5db605de20
4 changed files with 11 additions and 5 deletions

View File

@@ -5,4 +5,4 @@ If you add an `index.md` into a directory, it will become a part of the breadcru
Use it as overview for subpages of that directory:
- [Markdown cheat sheet](cheat-sheets/Markdown_cheat_sheet) - shows the markdown syntax.
- [Markdown cheat sheet](cheat_sheets/Markdown_cheat_sheet) - shows the markdown syntax.

View File

@@ -6,7 +6,10 @@ Place the content of your *slim wiki* into this directory. Write it using
Use the main page as overview and add links to subpages:
- [Cheat Sheets](cheat-sheets) - You can add links to directories having a `index.md`.
- [Markdown cheat sheet](cheat-sheets/Markdown_cheat_sheet) - Or add direct a link to a markdown file.
- [Cheat Sheets](cheat_sheets) - You can add links to directories having a `index.md`.
- [Markdown cheat sheet](cheat_sheets/Markdown_cheat_sheet) - Or add direct a link to a markdown file.
**Note:** The `.md` extension is optional when linking to markdown files.
**Notes:**
- The extension `.md` is optional when linking to markdown files.
- Underscores in directory or file names are shown as spaces in the breadcrumbs. So if you name your file `My_new_page.md`, it will be shown as `My new page`.

View File

@@ -56,7 +56,10 @@ class Main {
if ($isLast || file_exists($articleBaseDir . $currentPath . '/index.md')) {
// This is the requested file or an directory having an index -> Add it
$breadcrumbArray[] = array('name' => $pathPart, 'path' => urlencode($currentPath), 'active' => $isLast);
$breadcrumbArray[] = array(
'name' => str_replace('_', ' ', $pathPart),
'path' => urlencode($currentPath),
'active' => $isLast);
}
}