Skip to content

Commit

Permalink
chore: repace search plugin and add scaar
Browse files Browse the repository at this point in the history
the old search plugin isn't compatible with docusaurus 3.0
  • Loading branch information
htessaro committed Jun 20, 2024
1 parent 44177dc commit 823ab8a
Show file tree
Hide file tree
Showing 3 changed files with 2,255 additions and 195 deletions.
21 changes: 15 additions & 6 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@ const darkTheme = themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {

plugins: [
themes: [
[
require.resolve('@cmfcmf/docusaurus-search-local'),
{
require.resolve("@easyops-cn/docusaurus-search-local"),
({
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
searchResultContextMaxLength: 100,
indexBlog: false,
},
// For Docs using Chinese, The `language` is recommended to set to:
// ```
language: ["en"],
// ```
}),
],
],
plugins: [
require.resolve('docusaurus-plugin-image-zoom'),
],

Expand All @@ -33,7 +42,7 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: [ 'en', 'ja' ],
locales: [ 'en' ],
},

presets: [
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.2.0",
"@easyops-cn/docusaurus-search-local": "^0.44.2",
"@docusaurus/plugin-google-gtag": "^3.4.0",
"@docusaurus/core": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
Expand All @@ -23,7 +23,8 @@
"docusaurus-plugin-image-zoom": "^2.0.0",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"@scalar/docusaurus": "0.4.15"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.1",
Expand Down
Loading

0 comments on commit 823ab8a

Please sign in to comment.