Skip to content

Commit e665150

Browse files
author
54895y
committed
Add local search and manual DeepSeek AI search
1 parent 659393d commit e665150

9 files changed

Lines changed: 3105 additions & 118 deletions

File tree

docusaurus.config.ts

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';
44

55
const config: Config = {
66
title: 'Matrix Wiki',
7-
tagline: 'Matrix 系列插件官方文档',
7+
tagline: 'Matrix 系列插件官方文档',
88
favicon: 'img/logo.svg',
99
future: {
1010
v4: true,
@@ -19,6 +19,14 @@ const config: Config = {
1919
defaultLocale: 'zh-Hans',
2020
locales: ['zh-Hans'],
2121
},
22+
customFields: {
23+
aiSearch: {
24+
provider: 'deepseek',
25+
endpoint: 'https://api.deepseek.com/chat/completions',
26+
model: 'deepseek-chat',
27+
storageKey: 'matrixWiki.deepseekApiKey',
28+
},
29+
},
2230
presets: [
2331
[
2432
'classic',
@@ -35,6 +43,25 @@ const config: Config = {
3543
} satisfies Preset.Options,
3644
],
3745
],
46+
plugins: [
47+
[
48+
'@easyops-cn/docusaurus-search-local',
49+
{
50+
docsRouteBasePath: '/docs',
51+
indexBlog: false,
52+
indexPages: false,
53+
language: ['zh', 'en'],
54+
hashed: true,
55+
highlightSearchTermsOnTargetPage: true,
56+
explicitSearchResultPath: true,
57+
searchBarShortcut: true,
58+
searchBarShortcutKeymap: 'mod+k',
59+
searchBarPosition: 'right',
60+
searchResultLimits: 8,
61+
searchResultContextMaxLength: 100,
62+
},
63+
],
64+
],
3865
themeConfig: {
3966
image: 'img/logo.svg',
4067
colorMode: {
@@ -59,6 +86,8 @@ const config: Config = {
5986
{to: '/docs/matrixauth/overview', label: 'MatrixAuth', position: 'left'},
6087
{to: '/docs/matrixcook/overview', label: 'MatrixCook', position: 'left'},
6188
{to: '/docs/matrixshop', label: 'MatrixShop', position: 'left'},
89+
{type: 'search', position: 'right'},
90+
{to: '/ai-search', label: 'AI 搜索', position: 'right'},
6291
{
6392
href: 'https://github.com/54895y/54895y.github.io',
6493
label: 'GitHub',
@@ -73,13 +102,9 @@ const config: Config = {
73102
title: 'Documentation',
74103
items: [
75104
{
76-
label: '插件索引',
105+
label: '插件列表',
77106
to: '/docs/plugins',
78107
},
79-
{
80-
label: '站点说明',
81-
to: '/docs/intro',
82-
},
83108
],
84109
},
85110
{

0 commit comments

Comments
 (0)