diff options
author | Sandra McCann <samccann@redhat.com> | 2020-01-21 16:58:44 -0500 |
---|---|---|
committer | Alicia Cozine <879121+acozine@users.noreply.github.com> | 2020-01-21 15:58:44 -0600 |
commit | af0a72df3033719d2647a11d7629ac84a23293a3 (patch) | |
tree | b0f0580029bb765097911744ae3f606c6888a120 /docs | |
parent | c99f753239720650617ecfa2ba490cda5c951ccf (diff) | |
download | ansible-af0a72df3033719d2647a11d7629ac84a23293a3.tar.gz |
Add a banner which will display on the testing site. (#64763) (#66666)
* Add a banner which will display when the docs are published to the testing site.
Thanks to shane for the javascript code
Co-authored-by: Sandra McCann <samccann@redhat.com>
(cherry picked from commit 365820f871916663b0244d9de03101b28abc6a44)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html b/docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html index 3410f1e59a..28f2f5ccdc 100644 --- a/docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html +++ b/docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html @@ -1,6 +1,17 @@ <!--- Based on sphinx versionwarning extension. Extension currently only works on READTHEDOCS --> -{# Creates a banner at the top of the page for any version not latest. #} <script> + // Create a banner if we're not on the official docs site + if (location.host == "docs.testing.ansible.com") { + document.write('<div id="testing_banner_id" class="admonition important">'); + para = document.createElement('p'); + banner_text=document.createTextNode("This is a testing site. For the official docs go to https://docs.ansible.com/"); + para.appendChild(banner_text); + element = document.getElementById('testing_banner_id'); + element.appendChild(para); + document.write('</div>'); + } + + // Create a banner if we're not the latest version current_url = window.location.href; if ((current_url.search("latest") > -1) || (current_url.search("/{{ latest_version }}/") > -1)) { // no banner for latest release |