Skip to content

Commit 18315ba

Browse files
committed
feat: add attr section to DocLink
1 parent cda73f7 commit 18315ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/DocLink.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { getLinkToKey } from "../lib/doc-index";
33
44
interface Props {
55
src: string;
6+
section?: string;
67
}
78
8-
const { src } = Astro.props;
9+
const { src, section } = Astro.props;
910
const rawLink = await getLinkToKey(src);
1011
1112
const missing = rawLink === undefined;
12-
const link = rawLink ?? "";
13+
const link = rawLink ? rawLink + (section ? "#" + section : "") : "";
1314
---
1415

1516
{

0 commit comments

Comments
 (0)