1.1.42 • Published 2 years ago

docs-search v1.1.42

Weekly downloads
-
License
Senthil
Repository
-
Last release
2 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

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.39

2 years ago

1.1.41

2 years ago

1.1.40

2 years ago

1.1.42

2 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

3 years ago

1.1.30

3 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.20

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago