This commit is contained in:
Clement Tsang
2025-12-26 00:45:26 -05:00
parent 57f1e52e5f
commit 142f5f2588
3 changed files with 16 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
import os
import mkdocs.plugins
@mkdocs.plugins.event_priority(-100)
def on_config(config):
version = os.environ.get("MIKE_DOCS_VERSION")
if version == "nightly:"
extra = config.get("extra", {})
extra["nightly"] = True
+2
View File
@@ -147,6 +147,8 @@ extra:
provider: mike
default: stable
alias: true
# Used for the nightly banner
nightly: false
# Navigation
nav:
+1 -1
View File
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block announce %}
{% if version.name == "nightly" %}
{% if config.extra.nightly %}
<!-- Need to reapply margin from base CSS, which is overridden in extra CSS (to fix empty banner) -->
<div style="margin: 0.6rem auto">
This is <strong>nightly</strong> documentation, and it may differ from stable. Please see <strong><a href="{{ '../' ~ base_url }}">here for stable documentation</a></strong>.