-
Hi, New to mkdocs and mkdocs-material, both of which I'm finding most awesome with an amazingly simple learning curve, and have inspired me to create an additional handler for Apologies if this has been asked/answered but my search foo is failing me. In https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#versioning it describes how to implement a customisation to incorporate an "outdated" banner in my docs. This works an absolute treat, although I did have to spend a bit of trial-and-error with Now I'm wondering if it is possible to basically do the opposite of the outdated banner, and highlight when the user is on a "future" / pre-release version of the docs? At the moment I publish updated docs as Thusly it would be nice to highlight these docs as being pre-release. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Thanks for asking, and we're glad that you enjoy our work! There's currently no pre-release banner, and it's also not planned right now, but you could just use the announcement bar with some custom styling and only enable it on pre-release builds? How? That's left to be worked out, but maybe ask the authors of mike whether you can detect if you're running a pre-release build in the template. You could then define a custom announcement bar and only render it when you're on a pre-release build. I understand that this sounds involved, and I'm sorry that there's currently no easy way to do this, but it should be possible with some legwork. We will consider this feature in the future. |
Beta Was this translation helpful? Give feedback.
I've just had a chance to play with this and have come up with a fairly clean solution I think.
In
mkdocs.yml
, add anextra
attribute that is passed into thejinja2
template viamkdocs
itself:In
overrides/main.html
, use the passed variable in a conditional surrounding theannounce
block: