Skip to content

Commit ac4d282

Browse files
Add search box (#81)
Co-authored-by: Soha Jin <[email protected]>
1 parent 4a73d35 commit ac4d282

File tree

3 files changed

+407
-27
lines changed

3 files changed

+407
-27
lines changed

docusaurus.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Config } from '@docusaurus/types';
22
import type * as Preset from '@docusaurus/preset-classic';
3+
import type { PluginOptions as LocalSearchPluginOptions } from '@easyops-cn/docusaurus-search-local';
34
import { themes as PrismThemes } from 'prism-react-renderer';
45
import remarkMath from 'remark-math';
56
import rehypeKatex from 'rehype-katex';
@@ -49,6 +50,17 @@ export default {
4950
}
5051
} satisfies Preset.Options]
5152
],
53+
54+
themes: [
55+
['@easyops-cn/docusaurus-search-local', {
56+
indexDocs: true,
57+
indexBlog: false,
58+
docsRouteBasePath: ["/rules", "/manual", "/ula"],
59+
language: ["en", "zh"],
60+
hashed: true
61+
} satisfies LocalSearchPluginOptions]
62+
],
63+
5264
stylesheets: [{
5365
href: 'https://cdn.luogu.com.cn/assets/katex:0.16.7/katex.min.css',
5466
type: 'text/css',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"dependencies": {
1818
"@docusaurus/core": "^3.6.1",
1919
"@docusaurus/preset-classic": "^3.6.1",
20+
"@easyops-cn/docusaurus-search-local": "^0.45.0",
2021
"@mdx-js/react": "^3.1.0",
2122
"clsx": "^2.1.1",
2223
"prism-react-renderer": "^2.4.0",

0 commit comments

Comments
 (0)