Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search bar doesn't appear #114

Open
Skipper0707 opened this issue Oct 27, 2021 · 2 comments
Open

Search bar doesn't appear #114

Skipper0707 opened this issue Oct 27, 2021 · 2 comments

Comments

@Skipper0707
Copy link

Skipper0707 commented Oct 27, 2021

Hello
I've followed through the installation guide but, the search bar does not appear after the build as if the plugin's not working, I'm sure there's some misconfiguration on my part but, troubleshooting has been proving fruitless so far.
I'd be delighted if I'd get any help figuring this out.

Report: I entered the npm install --save @easyops-cn/docusaurus-search-local in my project directory and then added the plugin in the docusaurus.config.js as below:

There are no errors, everything seems fine but the search bar doesn't appear

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
  plugins: [
     [require.resolve("@easyops-cn/docusaurus-search-local"),
             {hashed: true}
     ],
  ],

  title: "TITLE",
  tagline: "TAGLINE",
  url: "https://your-docusaurus-test-site.com",
  baseUrl: "/",
  onBrokenLinks: "warn",
  onBrokenMarkdownLinks: "warn",
  favicon: "IMG",
  organizationName: "facebook", // Usually your GitHub org/user name.
  projectName: "docusaurus", // Usually your repo name.
  themeConfig: {
    navbar: {
      title: "TITLE",
      logo: {
        alt: "TITLE",
        src: "IMG"
      },
      items: [
        {
          type: "doc",
          docId: "Home",
          position: "left",
          label: "Documents"
        },
      ]
    },
    footer: {
      style: "dark",
      links: [
        {
          title: "Docs",
          items: [
            {
              label: "Home",
              to: "/docs/Home"
            },

          ]
        },
        ],
       },
    prism: {
      theme: lightCodeTheme,
      darkTheme: darkCodeTheme
    }
  },
  presets: [
    [
      "@docusaurus/preset-classic",
      {
        docs: {
          sidebarPath: require.resolve("./sidebars.js"),
          // Please change this to your repo.
          editUrl: "https://github.com/facebook/docusaurus/edit/master/website/"
        },
        blog: {
          showReadingTime: true,
          // Please change this to your repo.
          editUrl:
            "https://github.com/facebook/docusaurus/edit/master/website/blog/"
        },
        theme: {
          customCss: require.resolve("./src/css/custom.css")
        }
      }
    ]
  ]
};

I copied the whole config file in case it'd help figure this out.

Many thanks in advance.

@reutenkoivan
Copy link

facebook/docusaurus#6488
But in your case you can try configure plugins after presets

@noraj
Copy link

noraj commented Sep 3, 2022

@easyops-cn/docusaurus-search-local should be loaded in themes and not in plugins also you are missing this navbar item:

        {
          type: 'search',
          position: 'right',
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants