Skip to content

Commit

Permalink
add search
Browse files Browse the repository at this point in the history
  • Loading branch information
WheheoHu committed Oct 10, 2024
1 parent 357322f commit a0cb8f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
require('dotenv').config()

Expand Down Expand Up @@ -29,6 +29,9 @@ const config: Config = {
defaultLocale: 'en',
locales: ['en'],
},
plugins: [[require.resolve("@cmfcmf/docusaurus-search-local"), {
indexBlog: false,
},]],
presets: [
[
'classic',
Expand Down Expand Up @@ -77,12 +80,22 @@ const config: Config = {
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Intro',
},
{
to: 'docs/category/apis',
position: 'left',
label: 'API',
},
{
to: 'docs/category/settings-and-properties',
position: 'left',
label: 'Settings',
},
{
type: 'docsVersionDropdown',
position: 'right',
dropdownItemsAfter: [{to: '/versions', label: 'Update Info'}],
dropdownItemsAfter: [{ to: '/versions', label: 'Update Info' }],
dropdownActiveClassDisabled: true,
},
// {to: '/blog', label: 'Blog', position: 'left'},
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.2.0",
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/theme-search-algolia": "^3.5.2",
Expand All @@ -25,6 +26,7 @@
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"serve": "^14.2.3",
"yarn": "^1.22.22"
},
"devDependencies": {
Expand All @@ -47,5 +49,8 @@
},
"engines": {
"node": ">=18.0"
},
"resolutions": {
"cheerio": "1.0.0-rc.12"
}
}

0 comments on commit a0cb8f9

Please sign in to comment.