Skip to content

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

@sboy99

Description

@sboy99

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions