Skip to content

Commit

Permalink
doc: add docubetter link back
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed Dec 1, 2020
1 parent 94488f9 commit 7edd8dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
<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 %}
7 changes: 7 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
Expand All @@ -43,6 +49,7 @@ def latest_stable_release():
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"]
Expand Down

0 comments on commit 7edd8dd

Please sign in to comment.