Skip to content

Commit

Permalink
closes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarmb committed Aug 6, 2024
1 parent 1d45575 commit b65d5be
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions website/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ const fontMono = IBM_Plex_Mono({
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...components,
a: (props) => (
<Link {...props} href={props.href ? `/docs/${props.href}` : "/docs"} />
),
a: (props) => {
const isExternal = props.href?.startsWith("http");
return (
<Link
{...props}
href={isExternal ? props.href || "" : `/docs/${props.href}`}
target={isExternal ? "_blank" : undefined}
/>
);
},
img: (props) => {
if (props.src?.includes(".mp4")) {
return (
Expand Down

0 comments on commit b65d5be

Please sign in to comment.