jevstrudel.git / website / src / components / RightSidebar / RightSidebar.astro
RightSidebar.astro21 lines · 690 B · raw
1---
2import TableOfContents from './TableOfContents';
3import MoreMenu from './MoreMenu.astro';
4import type { MarkdownHeading } from 'astro';
5import AvatarList from '../Footer/AvatarList.astro';
6
7type Props = {
8  headings: MarkdownHeading[];
9  githubEditUrl?: string;
10};
11
12const { headings, githubEditUrl } = Astro.props as Props;
13let currentPage = Astro.url.pathname;
14// remove slash before #
15currentPage = currentPage.endsWith('/') ? currentPage.slice(0, -1) : currentPage;
16---
17
18<nav aria-labelledby="grid-right" class="w-64 text-foreground">
19  <TableOfContents client:media="(min-width: 50em)" headings={headings} currentPage={currentPage} />
20  <MoreMenu editHref={githubEditUrl} />
21</nav>