squidfunk/mkdocs-material

Search disappears on activating Blog plugin

Closed this issue · 2 comments

Context

I enabled the blog plugin on an existing MkDocs Material site and the search box disappeared from the main navigation.

Bug description

Search bar disappears on enabling the Blogs plugin.

Related links

Reproduction

A minimal reproduction has been created and attached. All version details, etc are included within the /docs/index.md.
min-mm.zip

Steps to reproduce

  1. Add blog configuration to the mkdocs.yml file
  2. Run mkdocs serve
  3. Visit site
  4. Observe that the search box does not exist any more.
Screenshot 2024-11-08 at 19 34 37

Browser

Chrome, Safari, Other

Before submitting

This is documented behavior. When you create a plugins section in the configuration you need to add all plugins that you want. I know it is somewhat surprising at first.

Thanks @alexvoss for the quick response. Adding search to the plugins fixed it beautifully!

For anyone else who stumbles upon this thread, the fix is as follows (the blog_toc is optional of course):

plugins:

  • search
  • blog:
    blog_toc: true