Skip to content

Commit 27f2dc3

Browse files
authored
search functionality (#130)
1 parent 3b7f4e6 commit 27f2dc3

File tree

3 files changed

+396
-11
lines changed

3 files changed

+396
-11
lines changed

docusaurus.config.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const config = {
3232
// may want to replace "en" with "zh-Hans".
3333
i18n: {
3434
defaultLocale: 'en',
35-
locales: ['en', 'es', 'fr', 'de', 'nl', 'zh', 'ja', 'ru', 'ko','sv', 'vi'],
35+
locales: ['en', 'es', 'fr', 'de', 'nl', 'zh', 'ja', 'ru', 'ko', 'sv', 'vi'],
3636
},
3737

3838
presets: [
@@ -50,6 +50,23 @@ const config = {
5050
],
5151
],
5252

53+
plugins: [
54+
[
55+
'docusaurus-lunr-search',
56+
{
57+
// Chinese isn't supported yet
58+
languages: ['en', 'es', 'fr', 'de', 'nl', 'ja', 'ru', 'ko', 'sv', 'vi'],
59+
// Keep max results to 10
60+
maxHits: 10,
61+
indexBatchSize: 100,
62+
excludeRoutes: [
63+
'docs/tags/**',
64+
'404'
65+
]
66+
}
67+
]
68+
],
69+
5370
themeConfig:
5471
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
5572
({
@@ -67,10 +84,10 @@ const config = {
6784
position: 'left',
6885
label: 'Docs',
6986
},
70-
{
71-
type: 'localeDropdown',
72-
position: 'right'
73-
},
87+
{
88+
type: 'localeDropdown',
89+
position: 'right'
90+
},
7491
{
7592
href: 'https://github.com/SideStore/',
7693
label: 'GitHub',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@docusaurus/preset-classic": "3.7.0",
1919
"@mdx-js/react": "^3.0.0",
2020
"clsx": "^2.0.0",
21+
"docusaurus-lunr-search": "^3.6.0",
2122
"prism-react-renderer": "^2.3.0",
2223
"react": "^18.0.0",
2324
"react-dom": "^18.0.0"

0 commit comments

Comments
 (0)