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
Plugins like search
need to be namespaced in overrides
#4581
Comments
Thanks for reporting! So this is actually an error that comes from a temporary transitional inconsistency between Insiders and the community edition. The transition from Why is it not merged yet? Because it's a pretty fundamental change that might break some builds (as yours). I've discussed this with @oprypin and he suggested to first test-drive this on a smaller group (Insiders) before merging it here. I'm glad we did this. When the next funding goal is hit, which should be a matter of weeks, the PR is merged and a new major release (version 9) will include upgrade instructions for template overrides.
What's wrong here is that you're copying the header partial from the community edition (this repository), not Insiders. If you use the In the meantime I'm sorry for the inconvenience this is causing. I'm closing this issue as there's nothing for us to do here. |
Hmm I think maybe it's better to switch sooner. As demonstrated by this report, by now we're more likely to get an issue from the discrepancy than an issue from the actual rename. And meanwhile I got a general inquiry towards why the original pull request "didn't do anything" 😅 |
The problem is that I would consider this a breaking change, thus a major version is necessary, and I don't want to release two major versions in close proximity. The search funding goal should be hit any time now. Furthermore, you're only impacted if you've overridden Edit: ah okay, I see, the user wants to use the default plugin while keeping Material for MkDocs installed. As said, I can't make the merge right now, so the best idea is to temporarily uninstall Material for MkDocs and/or use a virtual environment. |
@squidfunk do you think it'd be helpful to change the title of this issue to "MkDocs Material plugins like Maybe I missed some explicit reference to this elsewhere, but it took me a long while to find this solution after upgrading, and I was only able to find it because OP mentioned it in passing here. |
Yes, it's a good idea mentioning it. I'll also change the title |
search
need to be namespaced in overrides
Hi ! |
The new search was released with Material for MkDocs 9, so the comments in this thread are outdated as it's not exclusive to Insiders anymore. Make sure that you adjust your overrides to check for mkdocs-material/src/partials/header.html Lines 143 to 146 in 1c22ca4
|
Oh awesome ! Thank you very much ! |
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
For my site, I need to insert Sign Up / Log In buttons into the header, so I've been overriding
header.html
. I recently noticed that the search bar in my header disappeared, and after some investigation I discovered that overridingheader.html
with an exact replicate ofsrc/partials/header.html
also breaks the header.I guess this is not technically a bug, but I would argue that one should be able to copy any source
.html
partial into anoverrides/
directory, and (without making any modifications) it should behave exactly the same.I can fix my particular issue by changing
{% if "search" in config.plugins %}
to{% if "material/search" in config.plugins %}
, but this feels hacky.Expected behaviour
I would expect that overriding
header.html
with a replicate ofsrc/partials/header.html
should behave the same as not making the override at all.Actual behaviour
Suppose you have search enabled...
mkdocs.yml
If you override
header.html
with a replicate ofsrc/partials/header.html
, the search bar will not appear.Steps to reproduce
I have created a minimal reproducible example of this here.
mkdocs build && mkdocs serve
Notice the search bar is missing from the header.
Package versions
Configuration
System information
The text was updated successfully, but these errors were encountered: