]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
doc: add docubetter link back
authorKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 06:56:23 +0000 (14:56 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 16:25:16 +0000 (00:25 +0800)
check if the release being built is EOL when building the document, so
no need to use javascript to read releases.json anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/_templates/page.html
doc/conf.py

index bafb99c3fb0a22f434bd0ffbe271ed67fa2cc14e..5ba55c3e5d2a6f557e1367a2881ee253515ea8d7 100644 (file)
   <p class="last">This document is for an unsupported version of Ceph.</p>
 </div>
 
+{%- if not is_release_eol %}
+  <div id="docubetter" align="right" style="padding: 15px; font-weight: bold;">
+    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
+  </div>
+{%- endif %}
+
   {{ super() }}
 {% endblock %}
index ea5c9f24735ddb17efc403f033b441b6549fc74f..953e7dd779a77198dcbc4720d5832f48e5743fad 100644 (file)
@@ -30,6 +30,12 @@ def latest_stable_release():
         return next(iter(releases.keys()))
 
 
+def is_release_eol(codename):
+    with open(os.path.join(top_level, 'doc/releases/releases.yml')) as input:
+        releases = yaml.safe_load(input)['releases']
+        return 'actual_eol' in releases.get(codename, {})
+
+
 # project information
 project = 'Ceph'
 copyright = ('2016, Ceph authors and contributors. '
@@ -43,6 +49,7 @@ html_theme = 'ceph'
 html_theme_path = ['_themes']
 html_title = "Ceph Documentation"
 html_logo = 'logo.png'
+html_context = {'is_release_eol': is_release_eol(codename)}
 html_favicon = 'favicon.ico'
 html_show_sphinx = False
 html_static_path = ["_static"]