From ad44f0ceb6e8d1d8365891545a14531b48d8a591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Demirel?= Date: Sun, 29 Mar 2026 19:28:12 +0300 Subject: [PATCH] feat: add article's title to toc --- src/components/TableOfContents.astro | 16 ++++++++++++++-- src/pages/articles/[slug].astro | 7 +++++-- src/pages/en/articles/[slug].astro | 7 +++++-- src/styles/global.css | 10 ++++++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/components/TableOfContents.astro b/src/components/TableOfContents.astro index 19be069..458be58 100644 --- a/src/components/TableOfContents.astro +++ b/src/components/TableOfContents.astro @@ -2,9 +2,10 @@ interface Props { headings: Array<{ depth: number; slug: string; text: string }> label: string + title?: string } -const { headings, label } = Astro.props +const { headings, label, title } = Astro.props const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3) --- @@ -23,6 +24,17 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3) style="top: 0; left: -9px;" />