Icon for external link in Markdown #9138
-
|
Hi 👋 Is there a way to display an icon next to external link used in the Markdown files of which would render to |
Beta Was this translation helpful? Give feedback.
Answered by
peterpeterparker
Jul 20, 2023
Replies: 1 comment 1 reply
-
|
We don't offer a first-class API for this, but you can swizzle the import React from 'react';
import Link from '@docusaurus/Link';
import type {Props} from '@theme/MDXComponents/A';
export default function MDXA(props: Props): JSX.Element {
return <Link {...props} />;
}It should be easy there to detect an external URL and add an extra icon to the rendered output. If you need inspiration take a look at NavbarNavLink |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It does the job, merci Sébastien.