mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 15:03:57 +08:00
docs: add VitePress documentation site
- Add docs directory with VitePress configuration - Add GitHub Actions workflow for docs build and deploy - Support bilingual (English/Chinese) documentation - Include search, custom theme, and responsive design
This commit is contained in:
25
docs/.vitepress/search/flexsearch.mjs
Normal file
25
docs/.vitepress/search/flexsearch.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
export const FLEXSEARCH_INDEX_VERSION = 1
|
||||
|
||||
export function flexsearchEncode(text) {
|
||||
const normalized = String(text ?? '')
|
||||
.toLowerCase()
|
||||
.normalize('NFKC')
|
||||
|
||||
const tokens = normalized.match(
|
||||
/[a-z0-9]+|[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uac00-\ud7af]/g
|
||||
)
|
||||
|
||||
return tokens ?? []
|
||||
}
|
||||
|
||||
export const FLEXSEARCH_OPTIONS = {
|
||||
tokenize: 'forward',
|
||||
resolution: 9,
|
||||
cache: 100,
|
||||
encode: flexsearchEncode
|
||||
}
|
||||
|
||||
export function createFlexSearchIndex(FlexSearch) {
|
||||
return new FlexSearch.Index(FLEXSEARCH_OPTIONS)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user