Skip to content

Commit

Permalink
Add a local search plugin to documentation site (#1329)
Browse files Browse the repository at this point in the history
* docusaurus 2.0.0-beta.18

* Add a local search plugin to docs site
  • Loading branch information
deivid-rodriguez authored May 24, 2022
1 parent 5d2bb20 commit 989fcfa
Show file tree
Hide file tree
Showing 3 changed files with 1,327 additions and 549 deletions.
14 changes: 13 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
favicon: 'img/favicon.ico',
organizationName: 'activerecord-hackery',
projectName: 'ransack',
trailingSlash: false,
trailingSlash: true,

presets: [
[
Expand Down Expand Up @@ -103,6 +103,18 @@ const config = {
additionalLanguages: ['ruby', 'erb'],
},
}),

themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// needs to be the same as routeBasePath in @docusaurus/preset-classic config
docsRouteBasePath: '/'
},
]
]
};

module.exports = config;
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@docusaurus/core": "^2.0.0-beta.20",
"@docusaurus/preset-classic": "^2.0.0-beta.20",
"@easyops-cn/docusaurus-search-local": "^0.25.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
Expand Down
Loading

0 comments on commit 989fcfa

Please sign in to comment.