From 74b64c5a633244bf39a4cad115b54bf0dcb333ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Thu, 12 Jan 2023 17:04:19 +0000 Subject: [PATCH] add analytics support --- app/config.py | 1 + app/templates.py | 1 + app/templates/layout.html | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/app/config.py b/app/config.py index 4b6444b..62d863c 100644 --- a/app/config.py +++ b/app/config.py @@ -110,6 +110,7 @@ class Config(pydantic.BaseModel): custom_footer: str | None = None emoji: str | None = None also_known_as: str | None = None + ga_analytics: str | None = None hides_followers: bool = False hides_following: bool = False diff --git a/app/templates.py b/app/templates.py index 34b7f57..028a693 100644 --- a/app/templates.py +++ b/app/templates.py @@ -434,6 +434,7 @@ _templates.env.globals["JS_HASH"] = config.JS_HASH _templates.env.globals["CSS_HASH"] = config.CSS_HASH _templates.env.globals["BASE_URL"] = config.BASE_URL _templates.env.globals["TAGS"] = config.CONFIG.tags +_templates.env.globals["GA_ANALYTICS"] = config.CONFIG.ga_analytics _templates.env.globals["HIDES_FOLLOWERS"] = config.HIDES_FOLLOWERS _templates.env.globals["HIDES_FOLLOWING"] = config.HIDES_FOLLOWING _templates.env.globals["NAVBAR_ITEMS"] = config.NavBarItems diff --git a/app/templates/layout.html b/app/templates/layout.html index 0f7774d..3a58e30 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -1,6 +1,17 @@ +{% if GA_ANALYTICS %} + + + +{% endif %}