From 7a62303b57150814ff465eb611b69b3b2e9f03f1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 1 Dec 2020 15:16:15 +0800 Subject: [PATCH] doc: check "release" context variable for #dev-warning if $release is "dev", then the release being built is not a stable version. drop ceph.js, as the web page is generated at build time. since the last user of "releases.json" is gone, now we can drop the hooks preparing "releases.json" in conf.py as well. Signed-off-by: Kefu Chai --- doc/_static/js/ceph.js | 23 ----------------------- doc/_templates/page.html | 4 +++- doc/conf.py | 26 -------------------------- 3 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 doc/_static/js/ceph.js diff --git a/doc/_static/js/ceph.js b/doc/_static/js/ceph.js deleted file mode 100644 index 1d22a8b9e9ea..000000000000 --- a/doc/_static/js/ceph.js +++ /dev/null @@ -1,23 +0,0 @@ -$(function() { - var releases_url = DOCUMENTATION_OPTIONS.URL_ROOT + '_static/releases.json'; - - function get_branch() { - var pathname = window.location.pathname; - var res = pathname.match(/en\/([a-z]+)\/?/i) - if (res) { - return res[1] - } - return null; - } - - $.getJSON(releases_url, function(data) { - var branch = get_branch(); - if (branch === "master") { - $("#dev-warning").show(); - } else if (data && data.releases && branch in data.releases) { - return; - } else { - $("#dev-warning").show(); - } - }); -}); diff --git a/doc/_templates/page.html b/doc/_templates/page.html index a4d4236a3c27..3923975d78f0 100644 --- a/doc/_templates/page.html +++ b/doc/_templates/page.html @@ -1,10 +1,12 @@ {% extends "!page.html" %} {% block body %} -