Skip to content

Commit 9bebf1f

Browse files
committed
[Docs Site] Add topic tags to right sidebar
1 parent 3ed4480 commit 9bebf1f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/components/overrides/TableOfContents.astro

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,29 @@ import Default from "@astrojs/starlight/components/TableOfContents.astro";
33
44
import { Icon } from "@astrojs/starlight/components";
55
import FeedbackPrompt from "../FeedbackPrompt.tsx";
6+
7+
const tags = Astro.locals.starlightRoute.entry.data.tags;
68
---
79

810
<Default />
11+
{
12+
tags && (
13+
<>
14+
<br />
15+
<h2>Topic tags</h2>
16+
<div class="flex gap-2">
17+
{tags.map((tag) => (
18+
<a
19+
href={`/search/?tags=${tag}`}
20+
class="rounded-sm border border-(--sl-color-hairline) px-3 text-black"
21+
>
22+
{tag}
23+
</a>
24+
))}
25+
</div>
26+
</>
27+
)
28+
}
929
<br />
1030
<FeedbackPrompt client:idle />
1131
{

0 commit comments

Comments
 (0)