{#- Full replacement of shadcn's templates/seo.html. A custom_dir override with the same relative path shadows the theme's own file in Jinja's search order, so there is no parent `seo.html` left to call via `{{ super() }}` or `{% include %}` here — this file has to stand on its own. It keeps the theme's OG/Twitter meta shape but drives every title from our own `seo_title()`, and swaps the theme's generic Article JSON-LD (needs `page.meta.title` + `page.meta.description`, which most pages don't set) for BreadcrumbList + SoftwareSourceCode, which fire on every page. -#} {% block seo %} {#- Fixing site_url to the version path (see mkdocs.yml) makes every version self-canonical, so an archived version would otherwise compete with `latest` for the same queries. -#} {% if config.extra.rtd_version and config.extra.rtd_version != "latest" %} {% endif %} {#- One title for the tab and the social cards. The landing page carries the tagline, because "dature" alone says nothing about Python or config. `page.is_homepage` requires the page to be top-level in nav, but `index.md` is nested under "Getting Started" here, so it's always False for us — use the source path instead. -#} {% set is_home = page and page.file.src_uri == "index.md" %} {% macro seo_title() -%} {%- if page and page.meta and page.meta.title -%} {{ page.meta.title }} - {{ config.site_name }} {%- elif page and page.title and not is_home -%} {{ page.title | striptags }} - {{ config.site_name }} {%- elif config.extra.site_tagline -%} {{ config.site_name }} — {{ config.extra.site_tagline }} {%- else -%} {{ config.site_name }} {%- endif -%} {%- endmacro %}