mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
fix: right sidebar anchors earlier
This commit is contained in:
parent
b001d1d0f1
commit
64b8fd9584
@ -9,7 +9,8 @@ type Props = {
|
||||
};
|
||||
|
||||
const { headings, githubEditUrl } = Astro.props as Props;
|
||||
const currentPage = Astro.url.pathname;
|
||||
let currentPage = Astro.url.pathname;
|
||||
currentPage = currentPage.endsWith('/') ? currentPage.slice(0, -1) : currentPage;
|
||||
---
|
||||
|
||||
<nav aria-labelledby="grid-right" class="w-64 text-foreground">
|
||||
|
||||
@ -13,7 +13,6 @@ const TableOfContents: FunctionalComponent<{ headings: MarkdownHeading[]; curren
|
||||
currentPage,
|
||||
}) => {
|
||||
// remove slash before #
|
||||
currentPage = currentPage.endsWith('/') ? currentPage.slice(0, -1) : currentPage;
|
||||
const toc = useRef<any>();
|
||||
const onThisPageID = 'on-this-page-heading';
|
||||
const itemOffsets = useRef<ItemOffsets[]>([]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user