1.1.42 • Published 3 years ago

docs-search v1.1.42

Weekly downloads
-
License
Senthil
Repository
-
Last release
3 years ago

docs-search

Offline Search by lunr for Docusaurus V2

Prerequisites

worker_thread is needed, suggested node version > 12.X

How to Use ?

  1. Install this package
npm i docs-search --save
  1. Then run npm install to update, build, and link the packages
npm install
  1. Then run docusaurus swizzle
npm run swizzle docs-search SearchBar -- --danger
  1. Add the docs-search plugin to your docusaurus.config.js
module.exports = {
  // ...
    plugins: [require.resolve('docs-search')],
}
  1. Then build your Docusaurus project
npm run build
  1. Serve your application
npx http-server ./build

Note: Docusaurus search information can only be generated from a production build. Local development is currently not supported.

Language options

module.exports = {
  // ...
    plugins: [[ require.resolve('docs-search'), {
      languages: ['en', 'de'] // language codes
    }]],
}

Other options

excludeRoutes

You can exclude certain routes from the search by using this option:

module.exports = {
  // ...
    plugins: [
    [require.resolve('docs-search'), {
        excludeRoutes: [
            'docs/changelogs/**/*', // exclude changelogs from indexing
        ]
    }]
  ],
}

indexBaseUrl

Base url will not indexed by default, if you want to index the base url set this option to true

module.exports = {
  // ...
    plugins: [
        [require.resolve('docs-search'),
            {
                indexBaseUrl: true
            }
        ]
    ],
}

Thanks to algolia/docsearch.js, I modified it to create this search component

1.1.38

3 years ago

1.1.37

3 years ago

1.1.36

3 years ago

1.1.39

3 years ago

1.1.41

3 years ago

1.1.40

3 years ago

1.1.42

3 years ago

1.1.34

3 years ago

1.1.33

3 years ago

1.1.32

3 years ago

1.1.35

3 years ago

1.1.31

4 years ago

1.1.30

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago