3

Default Search bar does not show up in the header nav on a new site built using Docusaurus V2

enter image description here

but /search shows the search page:

enter image description here

Steps I followed:

  1. Created a new site using command npx @docusaurus/init@latest init mysite classic.
  2. Per documentation, classic should include Search https://docusaurus.io/docs/api/themes/@docusaurus/theme-search-algolia ?
  3. Added this to docusaurus.config.js
    themeConfig: {
     navbar: {
      items: [
        {
          type: 'search',
          position: 'right',
        },
     ...
     ...
    

The documentation here https://docusaurus.io/docs/search does not mention clearly how to the default search bar shows up. What am I missing?

Suren Konathala
  • 3,497
  • 5
  • 43
  • 73
  • 1
    Try to install `@docusaurus/theme-search-algolia` (https://docusaurus.io/docs/api/themes/@docusaurus/theme-search-algolia). I suppose that you need to connect Algolia (https://docusaurus.io/docs/search#connecting-algolia) as well. – DAle May 27 '21 at 10:30

1 Answers1

0

Please try:

$ npm install --save @docusaurus/theme-search-algolia

Reference to: https://github.com/facebook/docusaurus/issues/4975

Herald
  • 26
  • 3