1.1.42 • Published 1 year ago

docs-search v1.1.42

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

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.39

1 year ago

1.1.41

1 year ago

1.1.40

1 year ago

1.1.42

1 year ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.35

2 years ago

1.1.31

2 years ago

1.1.30

2 years ago

1.1.29

2 years ago

1.1.28

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago