From 2ffa85d85ee9c1e92a7b5bf4b707f5854bd25a49 Mon Sep 17 00:00:00 2001 From: Jim Enright Date: Thu, 26 Jun 2025 11:22:15 +0100 Subject: [PATCH 1/2] Add Umami tracking to header Signed-off-by: Jim Enright --- docsbuild/conf.py | 12 ++++++++++++ docsbuild/templates/layout.html | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docsbuild/templates/layout.html diff --git a/docsbuild/conf.py b/docsbuild/conf.py index a374f3e2..122fd53b 100644 --- a/docsbuild/conf.py +++ b/docsbuild/conf.py @@ -77,3 +77,15 @@ html_content = { "display_github": "True", } + +# Add templates directory to the templates_path (for extensions and custom templates) +templates_path = [ + "templates", +] + +# -- Adding Umami details to header ---------------------------------------- + +html_context = { + "umami_script_src": "https://umami.52.209.169.249.demo.cloudera-labs.com/script.js", + "umami_website_id": "9fde217e-c791-44f0-aa94-e78bb59394b3", +} \ No newline at end of file diff --git a/docsbuild/templates/layout.html b/docsbuild/templates/layout.html new file mode 100644 index 00000000..11877fa4 --- /dev/null +++ b/docsbuild/templates/layout.html @@ -0,0 +1,13 @@ +{# _templates/layout.html #} +{% extends "!layout.html" %} {# Extends the theme's default layout.html #} + +{% block extrahead %} + {{ super() }} {# This calls the original extrahead block content from the theme's layout.html #} + + {# Your Umami script #} + {% if umami_script_src and umami_website_id %} + + {% endif %} +{% endblock %} + +{# All other sections of the upstream layout.html are kept as is. #} \ No newline at end of file From 42d07ecd89483a1dc587a5e1a6b5aae7a44d73e9 Mon Sep 17 00:00:00 2001 From: Jim Enright Date: Thu, 26 Jun 2025 11:29:30 +0100 Subject: [PATCH 2/2] Fix lint issues Signed-off-by: Jim Enright --- docsbuild/conf.py | 2 +- docsbuild/templates/layout.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docsbuild/conf.py b/docsbuild/conf.py index 122fd53b..c6614018 100644 --- a/docsbuild/conf.py +++ b/docsbuild/conf.py @@ -88,4 +88,4 @@ html_context = { "umami_script_src": "https://umami.52.209.169.249.demo.cloudera-labs.com/script.js", "umami_website_id": "9fde217e-c791-44f0-aa94-e78bb59394b3", -} \ No newline at end of file +} diff --git a/docsbuild/templates/layout.html b/docsbuild/templates/layout.html index 11877fa4..ab4eca35 100644 --- a/docsbuild/templates/layout.html +++ b/docsbuild/templates/layout.html @@ -10,4 +10,4 @@ {% endif %} {% endblock %} -{# All other sections of the upstream layout.html are kept as is. #} \ No newline at end of file +{# All other sections of the upstream layout.html are kept as is. #}