Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Generate external links from mdx #1071

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Dec 12, 2024

Screenshot 2024-12-13 at 12 18 22 AM

Example external links on the about page: https://deploy-preview-1071--base-ui.netlify.app/react/overview/about

Closes #1033

@mj12albert mj12albert added the docs Improvements or additions to the documentation label Dec 12, 2024
@mui-bot
Copy link

mui-bot commented Dec 12, 2024

Netlify deploy preview

https://deploy-preview-1071--base-ui.netlify.app/

Generated by 🚫 dangerJS against a647d2b

@mj12albert mj12albert marked this pull request as ready for review December 12, 2024 16:19
@mj12albert mj12albert requested a review from vladmoroz December 12, 2024 16:19
Comment on lines 22 to 35
a: (props) => {
if (props.href.startsWith('http')) {
return (
<Link
target="_blank"
rel="noopener"
{...props}
className={clsx(props.className, 'inline-flex items-center gap-1')}
>
{props.children}
<ExternalLinkIcon />
</Link>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put it in the actual Link component so it can be reused in JSX too? (We'd need to clean the icon from the 404 page then).

@mj12albert mj12albert merged commit d477add into mui:master Dec 13, 2024
23 checks passed
@mj12albert mj12albert deleted the docs/external-links branch December 13, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Support automatic external links in page contents
3 participants