Skip to content

Commit

Permalink
fix(website): links to builtin documentation not showing in summary (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh authored May 10, 2024
1 parent e673b3c commit 5498e18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions apps/website/src/components/DocNode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link from 'next/link';
import { BuiltinDocumentationLinks } from '~/util/builtinDocumentationLinks';
import { OverlayScrollbarsComponent } from './OverlayScrollbars';
import { SyntaxHighlighter } from './SyntaxHighlighter';

Expand Down Expand Up @@ -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>;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/generateSplitDocumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) {
if (!foundItem && !resolved) {
return {
kind: DocNodeKind.LinkTag,
text: null,
text: codeDestination.memberReferences[0]?.memberIdentifier?.identifier ?? null,
};
}

Expand Down

0 comments on commit 5498e18

Please sign in to comment.