Skip to content

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

@Mister-Hope

Description

@Mister-Hope

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions