diff --git a/website/src/components/RightSidebar/RightSidebar.astro b/website/src/components/RightSidebar/RightSidebar.astro index 17ef167b..e6031e4d 100644 --- a/website/src/components/RightSidebar/RightSidebar.astro +++ b/website/src/components/RightSidebar/RightSidebar.astro @@ -10,6 +10,7 @@ type Props = { const { headings, githubEditUrl } = Astro.props as Props; let currentPage = Astro.url.pathname; +// remove slash before # currentPage = currentPage.endsWith('/') ? currentPage.slice(0, -1) : currentPage; --- diff --git a/website/src/components/RightSidebar/TableOfContents.tsx b/website/src/components/RightSidebar/TableOfContents.tsx index 878a933a..99c0eb54 100644 --- a/website/src/components/RightSidebar/TableOfContents.tsx +++ b/website/src/components/RightSidebar/TableOfContents.tsx @@ -12,7 +12,6 @@ const TableOfContents: FunctionalComponent<{ headings: MarkdownHeading[]; curren headings = [], currentPage, }) => { - // remove slash before # const toc = useRef(); const onThisPageID = 'on-this-page-heading'; const itemOffsets = useRef([]);