docs: redirect to docs.scylladb.com/manual/

Define a custom alert to redirect users to the latest version of the docs in https://docs.scylladb.com/manual/

Closes scylladb/scylladb#22636
This commit is contained in:
David Garcia
2025-02-02 12:18:57 +00:00
committed by Botond Dénes
parent bd9f51a29c
commit 6e61fc323b
2 changed files with 24 additions and 1 deletions

23
docs/_templates/version-warning.html vendored Normal file
View File

@@ -0,0 +1,23 @@
{% if flag != "manual" %}
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>
You're viewing documentation for a previous version.
<a href="https://docs.scylladb.com/manual/">Switch to the latest stable version.</a>
</p>
</div>
{% elif versions and current_version and latest_version and current_version != latest_version %}
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>
{% if current_version.name in theme_versions_unstable %}
You're viewing documentation for an unstable version of {{ project }}.
{% elif current_version.name in theme_versions_deprecated %}
You're viewing documentation for a deprecated version of {{ project }}.
{% else %}
You're viewing documentation for a previous version of {{ project }}.
{% endif %}
<a href="{{ vpathto(latest_version.name) }}">Switch to the latest stable version.</a>
</p>
</div>
{% endif %}

View File

@@ -196,7 +196,7 @@ htmlhelp_basename = "ScyllaDocumentationdoc"
html_baseurl = BASE_URL
# Dictionary of values to pass into the template engines context for all pages
html_context = {"html_baseurl": html_baseurl}
html_context = {"html_baseurl": html_baseurl, "flag": FLAG}
def setup(app):
if 'opensource' in app.tags: