From: Kefu Chai Date: Tue, 1 Dec 2020 06:56:23 +0000 (+0800) Subject: doc: add docubetter link back X-Git-Tag: v16.1.0~427^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7edd8dd0d034c4da1e6430d7395119e62ec8f1d2;p=ceph.git doc: add docubetter link back 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 --- diff --git a/doc/_templates/page.html b/doc/_templates/page.html index bafb99c3fb0a..5ba55c3e5d2a 100644 --- a/doc/_templates/page.html +++ b/doc/_templates/page.html @@ -11,5 +11,11 @@

This document is for an unsupported version of Ceph.

+{%- if not is_release_eol %} + +{%- endif %} + {{ super() }} {% endblock %} diff --git a/doc/conf.py b/doc/conf.py index ea5c9f24735d..953e7dd779a7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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"]