{#-
Material for MkDocs reads this file as theme.custom_dir. It adds the tags
that sites like Reddit, X, Slack and Discord read to show a card for a
shared link: the page's own title and description, and the repository's
social preview as the picture. frontend/social-preview.html is its source.
-#}
{% extends "base.html" %}
{% block extrahead %}
{{ super() }}
{%- if page.meta and page.meta.title -%}
{%- set preview_title = page.meta.title ~ " - " ~ config.site_name -%}
{%- elif page.title and not page.is_homepage -%}
{%- set preview_title = (page.title | striptags) ~ " - " ~ config.site_name -%}
{%- else -%}
{%- set preview_title = config.site_name -%}
{%- endif -%}
{%- set preview_description = (page.meta.description if page.meta and page.meta.description
else config.site_description) -%}
{% endblock %}