Skip to content

Commit 71e69f8

Browse files
committed
Use sphinxcontrib extension for google analytics
RTD theme has deprecated their support for it
1 parent 6b1a9a6 commit 71e69f8

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ doc/renames.rstgen: tools/names.py tools/renames.json
8787
env PYTHONPATH=. $(PYTHON) tools/names.py rst-gen > doc/renames.rstgen
8888

8989
doc-depends: ## pip installs packages needed to build doc
90-
$(PYTHON) -m pip install -U --upgrade-strategy eager sphinx sphinx_rtd_theme
90+
$(PYTHON) -m pip install -U --upgrade-strategy eager sphinx sphinx_rtd_theme sphinxcontrib-googleanalytics
9191

9292
dev-depends: ## pip installs packages useful for development (none are necessary except setuptools)
9393
$(PYTHON) -m pip install -U --upgrade-strategy eager build wheel setuptools pip

doc/conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def split(self, input):
2525
"sphinx.ext.autosummary",
2626
]
2727

28+
if not os.getenv("APSW_NO_GA"):
29+
extensions.append("sphinxcontrib.googleanalytics")
30+
googleanalytics_id = "G-2NR9GDCQLT"
31+
32+
2833
# this shows shorter names like Buffer instead of collections.abc.Buffer
2934
python_use_unqualified_type_names = True
3035
# less verbose Literal [ "one", "two"] -> "one" : "two"
@@ -81,13 +86,10 @@ def split(self, input):
8186
html_title = f"{ project } { version } documentation"
8287
html_theme = "sphinx_rtd_theme"
8388
html_theme_options = {
84-
"analytics_id": "G-2NR9GDCQLT",
8589
"prev_next_buttons_location": "both",
8690
}
8791
html_css_files = ["apsw.css"]
88-
89-
if os.getenv("APSW_NO_GA"):
90-
del html_theme_options["analytics_id"]
92+
html_baseurl = "https://rogerbinns.github.io/apsw/"
9193

9294
html_favicon = "favicon.ico"
9395

0 commit comments

Comments
 (0)