Skip to content

Commit 0057281

Browse files
committed
更新文档
1 parent 128fe65 commit 0057281

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: 创建一个vue插件
3+
createTime: 2025/11/16 15:49:03
4+
permalink: /develop_notes/vmn4gcxg/
5+
---
6+
7+
主要参考了 [luhaifeng666](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh2.0/getting-started/vue.html) 的教程,不过该文有些内容已经过时。
8+
9+
使用 [obsidian-sample-plugin](https://github.com/obsidianmd/obsidian-sample-plugin) 作为模板,或者你不想从头开始尝试可以直接使用海文东准备好的模板 [example-obsidian-plugin-vue](https://github.com/Hi-Windom/example-obsidian-plugin-vue)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: vuepress 搜索插件
3+
createTime: 2025/11/16 15:22:54
4+
permalink: /develop_notes/jwqi77f7/
5+
---
6+
7+
汐洛使用 [slimsearch](https://ecosystem.vuejs.press/zh/plugins/search/slimsearch.html) 替代了 plume 主题的默认本地搜索,不同的是我们使用 [@node-rs/jieba](https://www.npmjs.com/package/@node-rs/jieba) 而不是slimsearch文档中的 [nodejs-jieba](https://github.com/Mister-Hope/nodejs-jieba) 进行分词。
8+
9+
```ts title=".vuepress/config.ts"
10+
import { Jieba } from "@node-rs/jieba"; // [!code ++]
11+
import { dict } from "@node-rs/jieba/dict.js"; // [!code ++]
12+
13+
// Initialize Jieba with the default dictionary
14+
const jieba = Jieba.withDict(dict); // [!code ++]
15+
16+
export default defineUserConfig({
17+
/* 本地搜索, 默认启用 */
18+
search: false, // [!code highlight] 禁用 plume 自带的搜索插件
19+
20+
plugins: [
21+
// 分词构建后也生效,docs:preview 未生效可能是缓存问题
22+
slimsearchPlugin({ // [!code ++]
23+
indexContent: true, // [!code ++]
24+
suggestion: true, // [!code ++]
25+
indexOptions: { // [!code ++]
26+
tokenize: (text, fieldName) => { // [!code ++]
27+
return fieldName === "id" ? [text] : jieba.cut(text, true); // [!code ++]
28+
}, // [!code ++]
29+
}, // [!code ++]
30+
customFields: [ // [!code ++]
31+
{ // [!code ++]
32+
name: "author", // [!code ++]
33+
//@ts-ignore // [!code ++]
34+
getter: (page) => page.frontmatter.author, // [!code ++]
35+
formatter: "作者:$content", // [!code ++]
36+
}, // [!code ++]
37+
], // [!code ++]
38+
}), // [!code ++]
39+
]
40+
41+
})
42+
```
43+
44+
slimsearch 搜索结果不显示面包屑层级,这是个遗憾。

plume/docs/col_doc/1_developNotes/汐洛扩展.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ permalink: /develop_notes/ecxm75jp/
55
---
66
1. 汐洛绞架(规划中)
77
2. [VSCode](https://marketplace.visualstudio.com/items?itemName=Hi-Windom.sillot)
8-
3. Obsidian(规划中)
9-
4. Android Studio(规划中)
10-
5. Chromium 浏览器(维护中)
11-
6. Utools(规划中)
12-
7. rubick(规划中)
13-
8. KeePass 2(规划中)
14-
9. Jupyter Lab(规划中)
8+
3. Vuepress(本站内置)
9+
4. Obsidian(早期开发中)
10+
5. Android Studio(规划中)
11+
6. Chromium 浏览器(维护中)
12+
7. Firefox 浏览器(规划中)
13+
8. Utools(规划中)
14+
9. rubick(规划中)
15+
10. ~~KeePass 2(KeePass已被弃用)~~
16+
11. Jupyter Lab(规划中)

0 commit comments

Comments
 (0)