Skip to content

Commit 5498e18

Browse files
authored
fix(website): links to builtin documentation not showing in summary (discordjs#10267)
1 parent e673b3c commit 5498e18

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

apps/website/src/components/DocNode.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from 'next/link';
2+
import { BuiltinDocumentationLinks } from '~/util/builtinDocumentationLinks';
23
import { OverlayScrollbarsComponent } from './OverlayScrollbars';
34
import { SyntaxHighlighter } from './SyntaxHighlighter';
45

@@ -34,6 +35,21 @@ export async function DocNode({ node, version }: { readonly node?: any; readonly
3435
);
3536
}
3637

38+
if (node.text in BuiltinDocumentationLinks) {
39+
const href = BuiltinDocumentationLinks[node.text as keyof typeof BuiltinDocumentationLinks];
40+
return (
41+
<a
42+
key={`${node.text}-${idx}`}
43+
className="text-blurple hover:text-blurple-500 dark:hover:text-blurple-300"
44+
href={href}
45+
rel="external noreferrer noopener"
46+
target="_blank"
47+
>
48+
{node.text}
49+
</a>
50+
);
51+
}
52+
3753
return <span key={`${node.text}-${idx}`}>{node.text}</span>;
3854
}
3955

packages/scripts/src/generateSplitDocumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) {
328328
if (!foundItem && !resolved) {
329329
return {
330330
kind: DocNodeKind.LinkTag,
331-
text: null,
331+
text: codeDestination.memberReferences[0]?.memberIdentifier?.identifier ?? null,
332332
};
333333
}
334334

0 commit comments

Comments
 (0)