From a3a2bdc8f6c8d327bececb008bca2871b21bc829 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 25 May 2021 17:15:17 -0400 Subject: [PATCH] Keep version in header, only show selector if LAMMPS_WEBSITE_BUILD is set --- .../sphinx-config/_themes/lammps_theme/layout.html | 4 ++++ doc/utils/sphinx-config/conf.py.in | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/utils/sphinx-config/_themes/lammps_theme/layout.html b/doc/utils/sphinx-config/_themes/lammps_theme/layout.html index 1dad9ec4a9..845f213a4c 100644 --- a/doc/utils/sphinx-config/_themes/lammps_theme/layout.html +++ b/doc/utils/sphinx-config/_themes/lammps_theme/layout.html @@ -138,6 +138,10 @@ {% if READTHEDOCS and current_version %} {%- set nav_version = current_version %} {% endif %} + {% if nav_version %} +
Version: {{ nav_version }}
+
git info: {{ release }}
+ {% endif %} {% endif %} {% include "searchbox.html" %} diff --git a/doc/utils/sphinx-config/conf.py.in b/doc/utils/sphinx-config/conf.py.in index 8d3c88e727..cbe275f556 100644 --- a/doc/utils/sphinx-config/conf.py.in +++ b/doc/utils/sphinx-config/conf.py.in @@ -408,11 +408,13 @@ try: except NameError: html_context = dict() -html_context['display_manual_versions'] = True -html_context['current_version'] = version +is_website_build = os.environ.get('LAMMPS_WEBSITE_BUILD', '0') != '0' + +html_context['display_manual_versions'] = is_website_build +html_context['current_version'] = os.environ.get('LAMMPS_WEBSITE_BUILD', version) html_context['git_commit'] = git_commit html_context['versions'] = [ - ('latest', 'https://docs.lammps.org/'), - ('8 Apr 2021', 'https://lammps.sandia.gov/doc/') + ('latest', 'https://docs.lammps.org/latest/'), + (version, 'https://docs.lammps.org/') ] html_context['downloads'] = [('PDF', 'Manual.pdf')]