Skip to content

Commit cc52dca

Browse files
authored
moved latest warning banner logic to conf.py (#5508)
1 parent a65f391 commit cc52dca

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

docs/src/_templates/layout.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/src/conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ def _dotv(version):
331331
},
332332
}
333333

334+
# if we are building via Read The Docs and it is the latest (not stable)
335+
if on_rtd and rtd_version == "latest":
336+
html_theme_options[
337+
"announcement"
338+
] = f"""
339+
You are viewing the <b>latest</b> unreleased documentation
340+
<strong>{version}</strong>. You can switch to a
341+
<a href="https://scitools-iris.readthedocs.io/en/stable/">stable</a>
342+
version."""
343+
334344
rev_parse = run(["git", "rev-parse", "--short", "HEAD"], capture_output=True)
335345
commit_sha = rev_parse.stdout.decode().strip()
336346

0 commit comments

Comments
 (0)