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

How to prevent documents from being searched? #2874

Closed
yyrc opened this issue May 9, 2024 · 3 comments
Closed

How to prevent documents from being searched? #2874

yyrc opened this issue May 9, 2024 · 3 comments

Comments

@yyrc
Copy link

yyrc commented May 9, 2024

How to prevent documents from being searched?~

@Fun117
Copy link

Fun117 commented May 9, 2024

It's possible to prevent documents from being searched by removing the search box in the navigation bar. Below is an example code for achieving this. In this code, we are passing an empty element to the option to replace the search box in theme.config from the Docs Theme Configuration, effectively disabling the search functionality.

import type { DocsThemeConfig } from "nextra-theme-docs";

const config: DocsThemeConfig = {
  search: {
    component: <></>,
  }
};

export default config;

I hope this helps! Let me know if you need any further assistance.

@yyrc
Copy link
Author

yyrc commented May 9, 2024

Thank you, what should I do if I just want a document not to be searched?

@yyrc
Copy link
Author

yyrc commented May 9, 2024

Specify a document.~

@yyrc yyrc closed this as completed May 16, 2024
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

2 participants