Skip to content

Commit 4910ade

Browse files
authored
[Docs Site] Add edit / issue buttons to sidebar (cloudflare#20324)
* [Docs Site] Add edit / issue buttons to sidebar * hide buttons on support docs
1 parent 6cefb04 commit 4910ade

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/components/overrides/TableOfContents.astro

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,35 @@
22
import type { Props } from "@astrojs/starlight/props";
33
import Default from "@astrojs/starlight/components/TableOfContents.astro";
44
5+
import { Icon } from "@astrojs/starlight/components";
56
import FeedbackPrompt from "../FeedbackPrompt.tsx";
67
---
78

89
<Default {...Astro.props} />
10+
{
11+
!Astro.url.pathname.startsWith("/support/") && (
12+
<>
13+
<br />
14+
<div class="flex gap-2">
15+
{Astro.props.editUrl && (
16+
<a
17+
href={Astro.props.editUrl}
18+
class="h-8 cursor-pointer content-center rounded bg-cl1-brand-orange px-4 text-sm font-medium text-cl1-black"
19+
>
20+
<Icon name="pencil" />
21+
Edit
22+
</a>
23+
)}
24+
<a
25+
href="https://github.com/cloudflare/cloudflare-docs/issues/new/choose"
26+
class="h-8 cursor-pointer content-center rounded bg-cl1-brand-orange px-4 text-sm font-medium text-cl1-black"
27+
>
28+
<Icon name="github" />
29+
Issue
30+
</a>
31+
</div>
32+
</>
33+
)
34+
}
935
<br />
1036
<FeedbackPrompt client:idle />

0 commit comments

Comments
 (0)