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

Feat: Add a custom rehype plugin that differentiates between external & internal links #79

Open
sboy99 opened this issue Feb 14, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request feat | request help wanted Extra attention is needed

Comments

@sboy99
Copy link
Member

sboy99 commented Feb 14, 2023

Description

The issue is about creating a custom plugin that identifies internal and external type by string matching. Then it should wrap internal links with next Link component & for external links the link should open in a new tab.

Steps

  • Create a new file withNextLinks inside src/lib/mdx/rehype
  • Build an rehype plugin using visit function
  • Import the the plugin in getMdxComponents and enlist that plugin with rehypePlugins list

Screenshots

N/A

Additional Information

This feature will improve documentation experience. And will prevent unnecessary link opening and also will leverage the power of next Link component.

@sboy99 sboy99 added enhancement New feature or request help wanted Extra attention is needed feat | request labels Feb 14, 2023
@Aadarsh805 Aadarsh805 self-assigned this Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat | request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants