emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
238 stars 30 forks source link

Incorrect anchor links with baseUrl #52

Closed youngbeen closed 1 year ago

youngbeen commented 1 year ago

I followed the standard guide to config my vite.config.js. Everything is perfect except the links. My expect: window.location.origin + baseUrl + item link AS IS: window.location.origin + baseUrl + baseUrl + item link Problem is link has baseUrl twice?

e.g. when .vitepress/config.js has a baseUrl config

baseUrl: '/sub-domain/'

The link anchors to ${origin}/sub-domain/sub-domain/some-document

emersonbottero commented 1 year ago

can you share a repo?

zqy233 commented 1 year ago

vitepress^1.0.0-alpha.31 has this problem,^1.0.0-alpha.45 works well

pdanpdan commented 1 year ago

There were changes in vitepress - please use a recent version as the internals of vitepress changed (it is no longer sending the path including baseUrl) https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md - alpha.42