Skip to content

Commit bc49f0a

Browse files
authored
[stable-2.17] update banner to use RTD projects subdirs (#3241)
* update banner to use RTD projects subdirs (#3145) (cherry picked from commit 481c896) * fix urls to use RTD projects subfolder
1 parent b57012e commit bc49f0a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/docsite/.templates/banner.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% if is_eol %}
22
{# Creates a banner at the top of the page for EOL versions. #}
33
<div id='banner' class='Admonition caution'>
4-
<p>You are reading an unmaintained version of the Ansible community documentation. Unmaintained Ansible versions can contain security vulnerabilities (CVEs). Please upgrade to a maintained version. See <a href="/ansible/latest/">the latest Ansible documentation</a>. Note that this statement does not apply to Red Hat Ansible Automation Platform subscriptions. See the <a href="https://access.redhat.com/support/policy/updates/ansible-automation-platform">Ansible Automation Platform Life Cycle</a>.</p>
4+
<p>You are reading an unmaintained version of the Ansible community documentation. Unmaintained Ansible versions can contain security vulnerabilities (CVEs). Please upgrade to a maintained version. See <a href="https://docs.ansible.com/projects/ansible/latest/">the latest Ansible documentation</a>. Note that this statement does not apply to Red Hat Ansible Automation Platform subscriptions. See the <a href="https://access.redhat.com/support/policy/updates/ansible-automation-platform">Ansible Automation Platform Life Cycle</a>.</p>
55
</div>
66
{% else %}
77
<script>
@@ -27,7 +27,7 @@
2727
// Create a banner if we're not on the official docs site
2828
if (location.host == "docs.testing.ansible.com") {
2929
document.write('<div id="testing_banner_id" class="admonition important">' +
30-
'<p>This is the testing site for Ansible Documentation. Unless you are reviewing pre-production changes, please visit the <a href="https://docs.ansible.com/ansible/latest/">official documentation website</a>.</p> <p></p>' +
30+
'<p>This is the testing site for Ansible Documentation. Unless you are reviewing pre-production changes, please visit the <a href="https://docs.ansible.com/projects/ansible/latest/">official documentation website</a>.</p> <p></p>' +
3131
'</div>');
3232
}
3333
{% if available_versions is defined %}
@@ -36,16 +36,16 @@
3636

3737
var important = false;
3838
var msg = '<p>';
39-
if (startsWith(current_url_path, "/ansible-core/")) {
40-
msg += 'You are reading documentation for Ansible Core, which contains no plugins except for those in ansible.builtin. For documentation of the Ansible package, go to <a href="/ansible/latest">the latest documentation</a>.';
41-
} else if (startsWithOneOf(current_url_path, ["/ansible/latest/", "/ansible/{{ latest_version }}/"])) {
39+
if (startsWith(current_url_path, "/projects/ansible-core/")) {
40+
msg += 'You are reading documentation for Ansible Core, which contains no plugins except for those in ansible.builtin. For documentation of the Ansible package, go to <a href="https://docs.ansible.com/projects/ansible/latest/">the latest documentation</a>.';
41+
} else if (startsWithOneOf(current_url_path, ["/projects/ansible/latest/", "/projects/ansible/{{ latest_version }}/"])) {
4242
/* temp extra banner to advertise something */
4343
banner += extra_banner;
4444

4545
msg += 'This is the <b>latest</b> (stable) Ansible community documentation. For Red Hat Ansible Automation Platform subscriptions, see <a href="https://access.redhat.com/support/policy/updates/ansible-automation-platform">Life Cycle</a> for version details.';
46-
} else if (startsWith(current_url_path, "/ansible/2.9/")) {
46+
} else if (startsWith(current_url_path, "/projects/ansible/2.9/")) {
4747
msg += 'You are reading the latest Red Hat released version of the Ansible documentation. Community users can use this version, or select <b>latest</b> from the version selector to the left for the most recent community version.';
48-
} else if (startsWith(current_url_path, "/ansible/devel/")) {
48+
} else if (startsWith(current_url_path, "/projects/ansible/devel/")) {
4949
/* temp extra banner to advertise something */
5050
banner += extra_banner;
5151

0 commit comments

Comments
 (0)