Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a local search plugin to documentation site #1329

Merged
merged 2 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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