2019-06-28 22:06:49 +02:00
<!-- - Based on sphinx versionwarning extension. Extension currently only works on READTHEDOCS -->
< script >
2020-08-03 22:56:55 +02:00
startsWith = function(str, needle) {
return str.slice(0, needle.length) == needle
}
2019-12-23 18:15:47 +01:00
// 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 > ');
}
2020-07-17 22:07:35 +02:00
{% if (not READTHEDOCS) and (available_versions is defined) %}
// Create a banner if we're not the latest version
2020-08-03 22:56:55 +02:00
current_url_path = window.location.pathname;
if (startsWith(current_url_path, "/ansible/latest/") || startsWith(current_url_path, "/ansible/{{ latest_version }}/")) {
2020-07-17 22:07:35 +02:00
// no banner for latest release
2020-08-03 22:56:55 +02:00
} else if (startsWith(current_url_path, "/ansible/devel/")) {
2020-07-17 22:07:35 +02:00
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 > ');
}
{% endif %}
2019-06-28 22:06:49 +02:00
< / script >