Skip to content

Commit

Permalink
moved latest warning banner logic to conf.py (SciTools#5508)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkknight authored Oct 26, 2023
1 parent a65f391 commit cc52dca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
20 changes: 0 additions & 20 deletions docs/src/_templates/layout.html

This file was deleted.

10 changes: 10 additions & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ def _dotv(version):
},
}

# if we are building via Read The Docs and it is the latest (not stable)
if on_rtd and rtd_version == "latest":
html_theme_options[
"announcement"
] = f"""
You are viewing the <b>latest</b> unreleased documentation
<strong>{version}</strong>. You can switch to a
<a href="https://scitools-iris.readthedocs.io/en/stable/">stable</a>
version."""

rev_parse = run(["git", "rev-parse", "--short", "HEAD"], capture_output=True)
commit_sha = rev_parse.stdout.decode().strip()

Expand Down

0 comments on commit cc52dca

Please sign in to comment.