mirror of
https://github.com/til-schneider/slim-wiki.git
synced 2025-08-03 23:27:34 +02:00
Showing underscores in directory and file names as spaces in breadcrumbs
This commit is contained in:
@@ -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:
|
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.
|
@@ -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:
|
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`.
|
- [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.
|
- [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`.
|
||||||
|
@@ -56,7 +56,10 @@ class Main {
|
|||||||
|
|
||||||
if ($isLast || file_exists($articleBaseDir . $currentPath . '/index.md')) {
|
if ($isLast || file_exists($articleBaseDir . $currentPath . '/index.md')) {
|
||||||
// This is the requested file or an directory having an index -> Add it
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user