emersonbottero / vitepress-plugin-search

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

Indexed links are missing base when vitepress is not built with '/' base path #48

Closed pdanpdan closed 1 year ago

pdanpdan commented 1 year ago

The origin needs to be processed through withBase

import { useData, withBase } from "vitepress"; https://github.com/emersonbottero/vitepress-plugin-search/blob/faad6292b05428586d42dcafbe2076f64e8e330e/src/Search.vue#L3

origin.value = window.location.origin + withBase(locale.value === 'root' ? '/' : locale.value); https://github.com/emersonbottero/vitepress-plugin-search/blob/faad6292b05428586d42dcafbe2076f64e8e330e/src/Search.vue#L81

Also can you please also remove the index.html in the end of the link?

emersonbottero commented 1 year ago

fixed in #49

pdanpdan commented 1 year ago

Working as expected ~(except index.html at the end, but that is not a problem)~, thank you :)

sorry - index is also removed in prod, so it's all perfect