diff options
author | n-peugnet <n.peugnet@free.fr> | 2022-03-25 19:32:53 +0100 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2022-03-26 22:03:20 +0100 |
commit | a8fa2b290b1329ec576f264dc6bb470f819fda4d (patch) | |
tree | 4127e0dbdf90ea357b1798337aec4b07e6c38d3e /conf.py | |
parent | f688d73fa32bbdaa0a229a945ebd4c78b3bb6f61 (diff) | |
download | club1-docs-a8fa2b290b1329ec576f264dc6bb470f819fda4d.tar.gz club1-docs-a8fa2b290b1329ec576f264dc6bb470f819fda4d.zip |
add language switcher in sidebar
Diffstat (limited to 'conf.py')
-rw-r--r-- | conf.py | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -10,7 +10,7 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os +import os # import sys # sys.path.insert(0, os.path.abspath('.')) @@ -21,6 +21,7 @@ project = 'CLUB1' copyright = '2022, Nicolas PEUGNET' author = 'Nicolas PEUGNET' version = 'main' +release = version # -- General configuration --------------------------------------------------- @@ -46,6 +47,9 @@ templates_path = ['_templates'] # Usually you set "language" from the command line for these cases. language = 'fr' +# Set by make. +languages = os.environ['LANGUAGES'].split(' ') + # Use a single POT and PO file par language. gettext_compact = 'package' @@ -71,10 +75,11 @@ exclude_patterns = [ html_theme = 'sphinx_rtd_theme' html_context = { - 'display_github': True, - 'github_user': 'club-1', - 'github_repo': 'docs', - 'github_version': 'main/', + 'display_github': True, + 'github_user': 'club-1', + 'github_repo': 'docs', + 'github_version': f'{version}/', + 'languages': [(lang, f'../{lang}/') for lang in languages], } html_theme_options = { |