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

[Feature request] Provide isExternal options for markdown.links #1611

Open
Mister-Hope opened this issue Oct 5, 2024 · 0 comments
Open

[Feature request] Provide isExternal options for markdown.links #1611

Mister-Hope opened this issue Oct 5, 2024 · 0 comments

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Oct 5, 2024

Clear and concise description of the problem

In some cases, people may want to deploy multiple VuePress sites (or sites generated by other tools) in one directly.

For example:

  • /: a vuepress site
  • /api/: a site generated by typedoc

In this case, any links that is under /api/ should be marked external, however, the linksPlugin uses isLinkExternal from @vuepress/shared directly here:

if (isLinkExternal(hrefLink, base)) {

Suggested solution

Provide a isExternal option:

isExternal: (link: string, env: MarkdownEnv) => boolean

We can also use other formats, but it must expose base filePathRelative variables so that users can "resolve" final path to make a further judgement if necessary.

Alternative

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant