mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-30 08:23:18 -04:00
fix: right sidebar anchors earlier
This commit is contained in:
@@ -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[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user