mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(website): links to builtin documentation not showing in summary (#10267)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import { BuiltinDocumentationLinks } from '~/util/builtinDocumentationLinks';
|
||||
import { OverlayScrollbarsComponent } from './OverlayScrollbars';
|
||||
import { SyntaxHighlighter } from './SyntaxHighlighter';
|
||||
|
||||
@@ -34,6 +35,21 @@ export async function DocNode({ node, version }: { readonly node?: any; readonly
|
||||
);
|
||||
}
|
||||
|
||||
if (node.text in BuiltinDocumentationLinks) {
|
||||
const href = BuiltinDocumentationLinks[node.text as keyof typeof BuiltinDocumentationLinks];
|
||||
return (
|
||||
<a
|
||||
key={`${node.text}-${idx}`}
|
||||
className="text-blurple hover:text-blurple-500 dark:hover:text-blurple-300"
|
||||
href={href}
|
||||
rel="external noreferrer noopener"
|
||||
target="_blank"
|
||||
>
|
||||
{node.text}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
return <span key={`${node.text}-${idx}`}>{node.text}</span>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user