feat: add configurable custom HTML head injection (#118)

Allow deployers to inject custom HTML into the <head> of every page
via the CUSTOM_HEAD_HTML config option, useful for analytics scripts
(Plausible, Matomo, etc.) without modifying source.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jorijn Schrijvershof
2026-02-17 11:15:43 +01:00
committed by GitHub
parent de2290639f
commit edde12f17c
5 changed files with 42 additions and 0 deletions
+5
View File
@@ -727,6 +727,9 @@ def build_page_context(
"page_title": page_title,
"page_subtitle": page_subtitle,
"chart_groups": chart_groups,
# Custom HTML
"custom_head_html": cfg.custom_head_html,
}
@@ -1304,6 +1307,7 @@ def render_report_page(
"monthly_links": monthly_links,
"prev_report": prev_report,
"next_report": next_report,
"custom_head_html": cfg.custom_head_html,
}
template = env.get_template("report.html")
@@ -1341,6 +1345,7 @@ def render_reports_index(report_sections: list[dict]) -> str:
"css_path": "../",
"report_sections": report_sections,
"month_abbrs": month_abbrs,
"custom_head_html": cfg.custom_head_html,
}
template = env.get_template("report_index.html")