From d8e796e9604231a58dfa84abe163c5dd488d57e3 Mon Sep 17 00:00:00 2001 From: Rishi Raj Jain Date: Thu, 29 Sep 2022 17:45:00 +0530 Subject: [PATCH] fix trailing slash mismatch in dev vs build in docs example (#4912) --- examples/docs/src/components/LeftSidebar/LeftSidebar.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro index bd86aecd4e..c9ebe42587 100644 --- a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro +++ b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro @@ -7,7 +7,7 @@ type Props = { }; const { currentPage } = Astro.props as Props; -const currentPageMatch = currentPage.slice(1); +const currentPageMatch = currentPage.endsWith('/') ? currentPage.slice(1, -1) : currentPage.slice(1); const langCode = getLanguageFromURL(currentPage); const sidebar = SIDEBAR[langCode]; ---