fix: fuse dataPath build

This commit is contained in:
YunYouJun 2023-08-10 00:41:02 +08:00
parent 59a5b84476
commit c5e710fa46
3 changed files with 4 additions and 5 deletions

View File

@ -34,14 +34,15 @@ export default defineSiteConfig({
options: {
keys: ['title', 'tags', 'categories', 'excerpt', 'content'],
/**
* @default 0.6
* @see https://www.fusejs.io/api/options.html#threshold
* 设置匹配阈值,越低越精确
*/
threshold: 0.8,
// threshold: 0.6,
/**
* @default false
* @see https://www.fusejs.io/api/options.html#ignoreLocation
* 忽略位置
* @default false
* 这对于搜索文档全文内容有用,若无需全文搜索,则无需设置此项
*/
ignoreLocation: true,

View File

@ -81,8 +81,6 @@ function jumpToLink(link: string) {
v-if="open" ref="searchContainer"
class="yun-popup yun-search-popup yun-fuse-search flex-center" flex="col"
>
{{ keys }}
<div class="yun-search-input-container flex-center" w="full">
<input ref="searchInputRef" v-model="input" class="yun-search-input" :placeholder="t('search.placeholder')">
</div>

View File

@ -77,7 +77,7 @@ export function registerFuseCommand(cli: Argv<object>) {
const fuseList = await generateFuseList(options)
await fs.ensureDir('./dist')
const dataPath = ensurePrefix(options.config.siteConfig.fuse.dataPath, '/')
const dataPath = ensurePrefix('/', options.config.siteConfig.fuse.dataPath)
const publicRelativeFolder = `public${dataPath}`
const publicFolder = `${options.userRoot}/${publicRelativeFolder}`