Skip to content

[Bug report] Incorrect "internal" links when using base config #58

@NoahTheDuke

Description

@NoahTheDuke

Bug report

Description

It seems that the base config setting isn't being propagated to "internal" links, leading to incorrect links.

In my config, I have set the base config: base: "/fixture-riveter/". Then in the docs folder, in /api/README.md, I have written [fr](/api/fr/) to link to /api/fr/README.md. The generated incorrect link (with svg elided for readability) is:

<a href="/api/fr/" target="_blank" rel="noopener noreferrer">fr api<span><svg ...></svg><span class="sr-only">open in new window</span></span></a>

When working locally, if I remove the base setting, the link is now the correct <a href="/api/fr/" class="">fr api</a>. But this doesn't work when I push to my github pages, obviously.

Steps to reproduce

The incorrect link can be seen here.

Expected behavior

Links are generated correctly.

Environment info

  • Browser:
  • Output of vuepress info:
$ npx vuepress info

  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 2.02 GB / 32.00 GB
    Shell: 5.0.17 - /usr/local/bin/bash
  Binaries:
    Node: 12.13.0 - ~/.nodenv/versions/12.13.0/bin/node
    Yarn: Not Found
    npm: 7.5.3 - ~/.nodenv/versions/12.13.0/bin/npm
  Utilities:
    Git: 2.29.1 - /usr/local/bin/git
  Browsers:
    Chrome: 88.0.4324.150
    Edge: Not Found
    Firefox: 85.0.1
    Safari: 13.1
  npmPackages:
    @vuepress/bundler-webpack:  2.0.0-alpha.20
    @vuepress/cli:  undefined (2.0.0-alpha.20)
    @vuepress/client:  2.0.0-alpha.20
    @vuepress/core:  2.0.0-alpha.20
    @vuepress/markdown:  2.0.0-alpha.20
    @vuepress/plugin-active-header-links:  2.0.0-alpha.20
    @vuepress/plugin-back-to-top:  2.0.0-alpha.20
    @vuepress/plugin-container:  2.0.0-alpha.20
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-alpha.21
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-alpha.20
    @vuepress/plugin-nprogress:  2.0.0-alpha.20
    @vuepress/plugin-palette-stylus:  2.0.0-alpha.20
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/shared:  2.0.0-alpha.20
    @vuepress/theme-default:  2.0.0-alpha.21
    @vuepress/theme-vue: Not Found
    @vuepress/utils:  2.0.0-alpha.20
    vue:  3.0.5
    vue-loader:  16.1.2
    vue-router:  4.0.3
    vuepress: ^2.0.0-alpha.21 => 2.0.0-alpha.21

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions