Skip to content

Commit 5d43aa4

Browse files
authored
Add Umami metrics to header (#318)
Signed-off-by: Jim Enright <[email protected]>
1 parent 2849366 commit 5d43aa4

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

docsbuild/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@
6565
html_content = {
6666
"display_github": "True",
6767
}
68+
69+
# Add templates directory to the templates_path (for extensions and custom templates)
70+
templates_path = [
71+
"templates",
72+
]
73+
74+
# -- Adding Umami details to header ----------------------------------------
75+
76+
html_context = {
77+
"umami_script_src": "https://metrics.cloudera-labs.com/script.js",
78+
"umami_website_id": "ec9cdd83-3798-4fd0-8c07-acb4efd971de",
79+
}

docsbuild/templates/layout.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{# _templates/layout.html #}
2+
{% extends "!layout.html" %} {# Extends the theme's default layout.html #}
3+
4+
{% block extrahead %}
5+
{{ super() }} {# This calls the original extrahead block content from the theme's layout.html #}
6+
7+
{# Your Umami script #}
8+
{% if umami_script_src and umami_website_id %}
9+
<script defer src="{{ umami_script_src }}" data-website-id="{{ umami_website_id }}"></script>
10+
{% endif %}
11+
{% endblock %}
12+
13+
{# All other sections of the upstream layout.html are kept as is. #}

0 commit comments

Comments
 (0)