mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
chore: tweak
This commit is contained in:
parent
035d521e96
commit
e2b47da532
@ -3,7 +3,7 @@ import type { SearchPluginOptions } from '../shared/index.js'
|
||||
import { addViteOptimizeDepsInclude, getFullLocaleConfig } from '@vuepress/helper'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import { SEARCH_LOCALES } from './locales/index.js'
|
||||
import { onSearchIndexRemoved, onSearchIndexUpdated, prepareSearchIndex, prepareSearchIndexPlaceholder } from './prepareSearchIndex.js'
|
||||
import { /* onSearchIndexRemoved, onSearchIndexUpdated, */ prepareSearchIndex, prepareSearchIndexPlaceholder } from './prepareSearchIndex.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
@ -71,16 +71,16 @@ export function searchPlugin({
|
||||
}
|
||||
},
|
||||
|
||||
onPageUpdated: async (app, type, page) => {
|
||||
if (!page?.filePathRelative)
|
||||
return
|
||||
// onPageUpdated: async (app, type, page) => {
|
||||
// if (!page?.filePathRelative)
|
||||
// return
|
||||
|
||||
if (type === 'create' || type === 'update') {
|
||||
await onSearchIndexUpdated(app, { page, isSearchable, searchOptions })
|
||||
}
|
||||
else if (type === 'delete') {
|
||||
await onSearchIndexRemoved(app, { page, isSearchable, searchOptions })
|
||||
}
|
||||
},
|
||||
// if (type === 'create' || type === 'update') {
|
||||
// await onSearchIndexUpdated(app, { page, isSearchable, searchOptions })
|
||||
// }
|
||||
// else if (type === 'delete') {
|
||||
// await onSearchIndexRemoved(app, { page, isSearchable, searchOptions })
|
||||
// }
|
||||
// },
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user