Is it possible to disable the announcement bar with config or envrionment variable? #7254
-
Hello fellow mkdocs-material users, I need to create two separate builds of our documentation, where only one makes use of the announcement bar. I'm currently achieving this by having two separate theme override directories, each having a different With that said, I'm failing terribly with all my attempts:
The only thing that works for me is to re-implement the announcement block with the header block in the
I can now add some extra configuration to my
However, now I have one empty and unused Related: #6097, #5842, #3355 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Hello @lampensau, mkdocs-material/src/templates/base.html Lines 231 to 252 in 0c54a88 Therefore, if you have a block that is empty a black bar is still present, because the added Another option is to use dynamic template override with a hook: Updated version from the guide, haven't gotten the time to rewrite it with new scripts. Basically you need to connect the overriding hook to the manager to assure proper file backups etc.
So your options are:
|
Beta Was this translation helpful? Give feedback.
Hello @lampensau,
if you add
block announce
overrides in yourmain.html
theself.announce()
condition will trigger and will add the elements that are inside the conditional block but still outside of theannounce
block ofbase.html
mkdocs-material/src/templates/base.html
Lines 231 to 252 in 0c54a88