forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a banner message to warn when not on latest documentation (ansibl…
…e#58526) * add banner to versions that are not latest * move div into script * fix div * move comment * fix shippable errors
- Loading branch information
Showing
3 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!--- 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> | ||
current_url = window.location.href; | ||
if ((current_url.search("latest") > -1) || (current_url.search("/{{ latest_version }}/") > -1)) { | ||
// no banner for latest release | ||
} else if (current_url.search("devel") > -1) { | ||
document.write('<div id="banner_id" class="admonition caution">'); | ||
para = document.createElement('p'); | ||
banner_text=document.createTextNode("You are reading the *devel* version of the Ansible documentation - this version is not guaranteed stable. Use the version selection to the left if you want the latest stable released version."); | ||
para.appendChild(banner_text); | ||
element = document.getElementById('banner_id'); | ||
element.appendChild(para); | ||
document.write('</div>'); | ||
} else { | ||
document.write('<div id="banner_id" class="admonition caution">'); | ||
para = document.createElement('p'); | ||
banner_text=document.createTextNode("You are reading an older version of the Ansible documentation. Use the version selection to the left if you want the latest stable released version."); | ||
para.appendChild(banner_text); | ||
element = document.getElementById('banner_id'); | ||
element.appendChild(para); | ||
document.write('</div>'); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters