{% extends "base.html" %}
{#
MkDocs resolves a page's title from the `nav:` entry first, so the frontmatter
`title:` never reaches the
tag. Nav labels want to stay short ("FAQ",
"Usage") while the SERP title wants keywords, so pages carry a separate
`seo_title:` in their frontmatter and it wins here when present.
The homepage is the case Material can't express at all: it renders bare
`site_name` ("book-to-skill", 13 characters) with no room for what the project
actually does.
One title is computed here and reused by , og:title and twitter:title,
so the tab, the SERP and the share card can never drift apart.
#}
{% macro seo_title() -%}
{%- if page and page.meta and page.meta.seo_title -%}
{{ page.meta.seo_title }}
{%- elif page and page.is_homepage -%}
{{ config.site_name }} — Turn Any Book Into an AI Agent Skill
{%- elif page and page.title -%}
{{ page.title | striptags }} - {{ config.site_name }}
{%- else -%}
{{ config.site_name }}
{%- endif -%}
{%- endmacro %}
{% block htmltitle %}{{ seo_title() | e }}{% endblock %}
{% block extrahead %}
{#- Pages that exist for humans who took a wrong turn, not for the index. -#}
{%- if page and page.meta and page.meta.noindex %}
{%- endif %}
{#-
A single hand-made card, shared by every page, instead of the per-page PNGs
the Material social plugin renders. That plugin drags in Cairo and ~30s of
build time to produce a flat-purple card headlined with the nav label — which
on the most-shared URL of the site reads, in enormous type, "Home".
-#}
{%- set og_title = seo_title() -%}
{%- set og_description = page.meta.description if page and page.meta and page.meta.description else config.site_description -%}
{%- set og_image = config.site_url ~ "assets/og-card.jpg" -%}
{% endblock %}