From 96bd65a567b3ceaef2a8fe39618638e4c4dfc1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Wed, 2 Dec 2020 12:20:47 +0100 Subject: [PATCH] Fix .md replacement --- src/Controller/MenuAction.php | 2 +- src/Resources/views/search/index.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/MenuAction.php b/src/Controller/MenuAction.php index c75511c..4af5278 100644 --- a/src/Controller/MenuAction.php +++ b/src/Controller/MenuAction.php @@ -36,7 +36,7 @@ public function __invoke(Request $request): Response $menuItems = []; foreach ($finder as $file) { - $slug = rtrim($file->getRelativePathName(), '.md'); + $slug = preg_replace('/\.md$/', '', $file->getRelativePathName()); $menuItems[] = [ 'slug' => $slug, 'path' => $this->generateUrl('mobizel_markdown_docs_page_show', ['slug' => $slug]), diff --git a/src/Resources/views/search/index.html.twig b/src/Resources/views/search/index.html.twig index e9f64c2..11f7b32 100644 --- a/src/Resources/views/search/index.html.twig +++ b/src/Resources/views/search/index.html.twig @@ -4,7 +4,7 @@

Search results for terms "{{ app.request.get('query') }}"