Skip to content

Commit

Permalink
version update
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenn77 committed Dec 9, 2023
1 parent a7bab6a commit 3a3fe21
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ Offline Search for Docusaurus V2


## Prerequisites
`worker_thread` is needed, suggested node version > 12.X
For older version of node use `docusaurus-lunr-search` version `2.1.0`
(`npm i docusaurus-lunr-search@2.1.0`)
- Docusaurus V2 or V3
- Node.js >= 12.X

## How to Use ?
1. Install this package
```
yarn add docusaurus-lunr-search
```
In case you are using npm
```
npm i docusaurus-lunr-search --save
```
2. Then run `npm install` to update, build, and link the packages
If npm install fails to install with error `unable to resolve dependency tree`, run `npm i --legacy-peer-deps`

2. Some time npm fails to install `lunr` package, in that case install `lunr` package manually
```
npm install
npm i lunr --save
```

3. Add the docusaurus-lunr-search plugin to your `docusaurus.config.js`
```
module.exports = {
Expand All @@ -38,16 +44,20 @@ module.exports = {

4. Then build your Docusaurus project
```
yarn build
```
or
```
npm run build
```

5. Serve your application
```
npm run serve
yarn serve
```
or

```
npx http-server ./build
npm run serve
```

Note: Docusaurus search information can only be generated from a production build. Local development is currently not supported.
Expand Down Expand Up @@ -95,11 +105,13 @@ indirect children (E.g. 'grandchildren' nodes).
Check this [issue #115](https://github.com/praveenn77/docusaurus-lunr-search/issues/115) for more details.

## Upgrading from docusaurus V2 to V3
Update the `docusaurus-lunr-search` version to `3.3.0` or higher
Update the `docusaurus-lunr-search` version to `3.3.0` or higher in `package.json` file

Remove `src/theme/SearchBar` folder if you swizzled it before, if the folder does not exist then ignore this step.

Do `npm install` and `npm run build` again
Do `yarn install` or `npm install`

If npm install fails to install with error `unable to resolve dependency tree`, run `npm i --legacy-peer-deps`

## Credits

Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-lunr-search",
"version": "3.3.0",
"version": "3.3.1",
"description": "Offline search component for Docusaurus V2",
"main": "src/index.js",
"publishConfig": {
Expand Down Expand Up @@ -50,7 +50,6 @@
"lunr-languages": "^1.4.0",
"mark.js": "^8.11.1",
"minimatch": "^3.0.4",
"object-assign": "^4.1.1",
"rehype-parse": "^7.0.1",
"to-vfile": "^6.1.0",
"unified": "^9.0.0",
Expand Down

0 comments on commit 3a3fe21

Please sign in to comment.