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 Link from 'next/link';
|
||||||
|
import { BuiltinDocumentationLinks } from '~/util/builtinDocumentationLinks';
|
||||||
import { OverlayScrollbarsComponent } from './OverlayScrollbars';
|
import { OverlayScrollbarsComponent } from './OverlayScrollbars';
|
||||||
import { SyntaxHighlighter } from './SyntaxHighlighter';
|
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>;
|
return <span key={`${node.text}-${idx}`}>{node.text}</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) {
|
|||||||
if (!foundItem && !resolved) {
|
if (!foundItem && !resolved) {
|
||||||
return {
|
return {
|
||||||
kind: DocNodeKind.LinkTag,
|
kind: DocNodeKind.LinkTag,
|
||||||
text: null,
|
text: codeDestination.memberReferences[0]?.memberIdentifier?.identifier ?? null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user