From 88d15d100e8f266dec1a65507588829e4aa2e930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Mon, 9 Feb 2026 22:38:19 +0100 Subject: [PATCH] feat(mkdocs): The page HTML title should use the first heading if available This allows us to have a 'long title' as an H1 heading, and a 'short title' in the navigation bar. The HTML title will use the long title, which is better for SEO. Inspired by https://github.com/mkdocs/mkdocs/issues/1795#issuecomment-493372650 Closes https://gitlab.com/opensavvy/playgrounds/baseline/-/issues/39 --- docs/website/overrides/main.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/website/overrides/main.html diff --git a/docs/website/overrides/main.html b/docs/website/overrides/main.html new file mode 100644 index 00000000..bc1e8e6b --- /dev/null +++ b/docs/website/overrides/main.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block htmltitle %} + {% if page.toc | first is defined %} + {{ page.toc.items[0].title }} - {{ config.site_name }} + {% else %} + {{ super() }} + {% endif %} +{% endblock %} -- 2.51.2