cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
437 stars 67 forks source link

Support Docusaurus 2.0 stable #131

Closed Fannon closed 1 year ago

Fannon commented 2 years ago

Docusaurus 2 is out 🎆 ! https://docusaurus.io/blog/2022/08/01/announcing-docusaurus-2.0

The current version of this plugin still has an outdated peer dependency:

npm ERR! Conflicting peer dependency: @docusaurus/core@2.0.1
npm ERR! node_modules/@docusaurus/core
npm ERR!   peer @docusaurus/core@"^v2.0.0-beta.21" from @cmfcmf/docusaurus-search-local@0.11.0
npm ERR!   node_modules/@cmfcmf/docusaurus-search-local
npm ERR!     @cmfcmf/docusaurus-search-local@"0.11.0" from the root project

It can be force installed via

npm i --legacy-peer-deps

But when trying this quicky, I'm not sure if it worked, the search index couldn't be found even after running a build. So maybe some additional work needs to be done to get it on 2.0 officially.

Thanks for working on this plugin, it's really helpful!

noraj commented 2 years ago

In docusaurus v2.1.0 the search bar doesn't display even when having this navbar item:

        {
          type: 'search',
          position: 'right',
        }
cmfcmf commented 1 year ago

I finally added support for Docusaurus v2 in https://github.com/cmfcmf/docusaurus-search-local/commit/f8619b72ec748ac084b53cf7c88157419a27863a.