From 639173da6bf1917ca227ac20f91f19eea2ae4403 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 3 Aug 2023 14:05:17 +0200 Subject: [PATCH] Generalize analytics support in default theme As the number of privacy-preserving analytics options proliferates, it no longer makes sense to support specific solutions provided by ad-tracking corporations. --- docs/publish.rst | 2 +- docs/settings.rst | 19 ++++++------- .../themes/notmyidea/templates/analytics.html | 27 ++----------------- .../themes/simple/templates/gosquared.html | 14 ---------- 4 files changed, 13 insertions(+), 49 deletions(-) delete mode 100644 pelican/themes/simple/templates/gosquared.html diff --git a/docs/publish.rst b/docs/publish.rst index 46913dea..f5ebfff5 100644 --- a/docs/publish.rst +++ b/docs/publish.rst @@ -67,7 +67,7 @@ Deployment After you have generated your site, previewed it in your local development environment, and are ready to deploy it to production, you might first -re-generate your site with any production-specific settings (e.g., analytics +re-generate your site with any production-specific settings (e.g., analytics, feeds, etc.) that you may have defined:: pelican content -s publishconf.py diff --git a/docs/settings.rst b/docs/settings.rst index 44108ea2..8417e209 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1245,18 +1245,19 @@ Feel free to use them in your themes as well. Your GitHub URL (if you have one). It will then use this information to create a GitHub ribbon. -.. data:: GOOGLE_ANALYTICS +.. data:: ANALYTICS - Set to ``UA-XXXXX-Y`` Property's tracking ID to activate Google Analytics. + Put any desired analytics scripts in this setting in ``publishconf.py``. + Example: -.. data:: GA_COOKIE_DOMAIN + .. parsed-literal:: - Set cookie domain field of Google Analytics tracking code. Defaults to - ``auto``. - -.. data:: GOSQUARED_SITENAME - - Set to 'XXX-YYYYYY-X' to activate GoSquared. + ANALYTICS = """ + + + """ .. data:: MENUITEMS diff --git a/pelican/themes/notmyidea/templates/analytics.html b/pelican/themes/notmyidea/templates/analytics.html index 071c77f7..22642579 100644 --- a/pelican/themes/notmyidea/templates/analytics.html +++ b/pelican/themes/notmyidea/templates/analytics.html @@ -1,26 +1,3 @@ -{% if GOOGLE_ANALYTICS %} - -{% endif %} -{% if GAUGES %} - +{% if ANALYTICS %} +{{ ANALYTICS }} {% endif %} diff --git a/pelican/themes/simple/templates/gosquared.html b/pelican/themes/simple/templates/gosquared.html deleted file mode 100644 index 49ccbbef..00000000 --- a/pelican/themes/simple/templates/gosquared.html +++ /dev/null @@ -1,14 +0,0 @@ -{% if GOSQUARED_SITENAME %} - -{% endif %}