From c23165307b49ab784a98d13612e1b06808cf7399 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 26 Jul 2022 15:08:15 +1000 Subject: [PATCH] version banner fixes (#331) * version banner fixes * More context * Banner tweaks * Template fix * HTML tweaks * Banner simplificatio --- _includes/overrides/banner.html | 15 ++++++++------- docs/hooks.py | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/_includes/overrides/banner.html b/_includes/overrides/banner.html index 5040ffa..a475b24 100644 --- a/_includes/overrides/banner.html +++ b/_includes/overrides/banner.html @@ -1,13 +1,14 @@ -{% if config.extra.version %} +{% if config.version_banner %}
- {% if config.extra.version == "latest" %} - This documentation is for the development version of InvenTree, which may be significantly different from previous stable releases. - For stable release documentation, use the version selector located in the bottom right corner of this page. - {% elif self.outdated() %} - This documentation is for an outdated version of InvenTree. - For updated release documentation, use the version selector located in the bottom right corner of this page. + + {% if config.readthedocs.version == 'latest' %} + This documentation is for the development version of InvenTree, which may be significantly different from the stable releases. + {% else %} + This documentation is for an outdated version of InvenTree. {% endif %} + For stable release documentation, use the version selector located in the bottom right corner of this page. +
{% endif %} diff --git a/docs/hooks.py b/docs/hooks.py index a7d38a2..1bd9fff 100644 --- a/docs/hooks.py +++ b/docs/hooks.py @@ -49,6 +49,10 @@ def on_config(config, *args, **kwargs): # Supply this to the context config['readthedocs'] = readthedocs + # Determine if we want to display a 'version' banner + # Basically we do, *unless* we are displaying the "stable" version + config['version_banner'] = rtd_version != 'stable' + else: print("'READTHEDOCS' environment variable not found") print("Building for localhost configuration!")