From 826f715176beff8171f718fd8ee822e67a67c3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20St=C3=BCckler?= Date: Thu, 5 Oct 2023 16:51:43 +0200 Subject: [PATCH] fix: toc links --- src/components/TableOfContents.tsx | 13 +++++++++---- src/layouts/AcademyContent.astro | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/TableOfContents.tsx b/src/components/TableOfContents.tsx index 5175a369..0455933a 100644 --- a/src/components/TableOfContents.tsx +++ b/src/components/TableOfContents.tsx @@ -1,12 +1,12 @@ import React from "react"; -import type { MarkdownHeading } from 'astro'; +import type { MarkdownHeading } from "astro"; interface Props { title: string; headlines: Array; + baseUrl?: string; } - const buildTocList = (input: Array) => { // Create a ordered list of depth and remove duplicates let map = new Map( @@ -28,7 +28,7 @@ const paddingMapping = { 6: "pl-20", }; -const TableOfContents: React.FC = ({ title, headlines }) => { +const TableOfContents: React.FC = ({ title, headlines, baseUrl }) => { const headlinesWithoutDepthGaps = buildTocList(headlines); return (