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

Feature offline search #23

Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $ npm start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

**Note:** The Serach bar does not run in development mode and will be greyed out. To test the serach. Use the Build and Test commands below.

### Build

It would help if you verified all your changes with a local build.
Expand Down
7 changes: 6 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ const config = {
// { to: '/blog', label: 'Blog', position: 'left' },
{
type: 'search',
position: 'right',
position: 'left',
},
{
type: 'custom-customSearchBar',
position: "right",
},
{
to: 'https://www.shesha.io/get-started-with-shesha',
Expand Down Expand Up @@ -172,6 +176,7 @@ const config = {
defer: true,
}
],
plugins: [require.resolve('docusaurus-lunr-search')]
};

export default config;
3,910 changes: 2,236 additions & 1,674 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@ant-design/icons": "^5.2.6",
"@docusaurus/core": "3.0.0",
"@docusaurus/preset-classic": "3.0.0",
"@mdx-js/react": "^3.0.0",
"antd": "^5.11.1",
"clsx": "^1.2.1",
"markdown-to-jsx": "^7.3.2",
"@ant-design/icons": "^5.4.0",
"@docusaurus/core": "3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@mdx-js/react": "^3.0.1",
"antd": "^5.20.0",
"clsx": "^2.1.1",
"docusaurus-lunr-search": "^3.4.0",
"markdown-to-jsx": "^7.4.7",
"package.json": "^2.0.1",
"prism-react-renderer": "^2.3.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.12.0"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/types": "3.0.0"
"@docusaurus/module-type-aliases": "3.4.0",
"@docusaurus/types": "3.4.0"
},
"browserslist": {
"production": [
Expand Down
1 change: 1 addition & 0 deletions src/components/custom-search/css/CustomSearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
box-sizing: border-box;
border-radius: 4px;
flex-direction: row;
margin-right: 8px;
}

.custom-search-option {
Expand Down
12 changes: 12 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,18 @@ ul.circle>li:before {
}
}

.search-bar {
border-radius: 5px;
}

html[data-theme='light'] .algolia-docsearch-suggestion--category-header {
font-size: small;
}

html[data-theme='datk'] .algolia-docsearch-suggestion--category-header {
font-size: small;
}

.footerWrapper {
margin-top: 20px;
}
Expand Down
7 changes: 7 additions & 0 deletions src/theme/NavbarItem/ComponentTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ComponentTypes from '@theme-original/NavbarItem/ComponentTypes';
import CustomSearchBar from '@site/src/components/custom-search/CustomSearchBar';

export default {
...ComponentTypes,
'custom-customSearchBar': CustomSearchBar,
};
10 changes: 0 additions & 10 deletions src/theme/SearchBar.js

This file was deleted.