aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-03-29 01:51:05 +0200
committern-peugnet <n.peugnet@free.fr>2022-03-29 01:51:05 +0200
commit9ae9d0e29de622c30d0625e7d124f260b3242ae3 (patch)
tree924318246db5c4993e9ee51e2e83e66ac6eb6314
parentdde2e2757c033ee1dff2aecfe445f1058eb6ef42 (diff)
downloadclub1-docs-9ae9d0e29de622c30d0625e7d124f260b3242ae3.tar.gz
club1-docs-9ae9d0e29de622c30d0625e7d124f260b3242ae3.zip
feat: remove "edit on githu" link outside french
-rw-r--r--Makefile2
-rw-r--r--conf.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index fca9e4c..a5326aa 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ $(SPHINXBUILDERS): %: $(LANGUAGES:%=\%/%);
# Localized Sphinx builders
.SECONDEXPANSION:
$(SPHINXLBUILDERS): $$(if $$(filter fr,$$(@F)),,locales/$$(@F)/LC_MESSAGES/package.mo locales/$$(@F)/LC_MESSAGES/sphinx.mo)
- $(SPHINXBUILD) -b $(@D) "$(SOURCEDIR)" "$(BUILDDIR)/$(@D)/$(@F)" -D language=$(@F) $(SPHINXOPTS) $O
+ LANGUAGE=$(@F) $(SPHINXBUILD) -b $(@D) "$(SOURCEDIR)" "$(BUILDDIR)/$(@D)/$(@F)" $(SPHINXOPTS) $O
# Other Sphinx commands for autocompletion
$(SPHINXCMDS):
diff --git a/conf.py b/conf.py
index 0873cd6..4c854b2 100644
--- a/conf.py
+++ b/conf.py
@@ -44,7 +44,7 @@ templates_path = ['_templates']
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
-language = 'fr'
+language = os.environ['LANGUAGE']
# Set by make.
languages = os.environ['LANGUAGES'].split(' ')
@@ -76,8 +76,10 @@ exclude_patterns = [
#
html_theme = 'sphinx_rtd_theme'
+html_show_sourcelink = language == 'fr'
+
html_context = {
- 'display_github': True,
+ 'display_github': language == 'fr',
'github_user': 'club-1',
'github_repo': 'docs',
'github_version': f'{version}/',