diff --git a/_templates/page.html b/_templates/page.html index 4a59ca1..07ae95c 100644 --- a/_templates/page.html +++ b/_templates/page.html @@ -1,7 +1,18 @@ {%- extends "!page.html" %} -{%- block extrahead %} - - -{{ super() }} -{% endblock extrahead %} +{% block extrahead %} + {{ super() }} + + {# Verifies sphinx_version availability before rendering metatags + This check is crucial to prevent errors during site generation + when sphinxext.opengraph extension is not available #} + {% if sphinx_version %} + {{ metatags }} + {% endif %} + + {# Static meta tags manually defined to ensure consistency + These tags will remain unchanged regardless of Sphinx configuration + or its extensions, ensuring a constant site identity #} + + +{% endblock %} \ No newline at end of file diff --git a/conf.py b/conf.py index 06e4b74..75b904c 100644 --- a/conf.py +++ b/conf.py @@ -432,3 +432,5 @@ "line_color": "#4078c0", "image": "_static/logo/logo.png", } +# Ensures og:image meta tag generation which is not always generated by sphinxext.opengraph +ogp_image = "_static/logo/logo.png" \ No newline at end of file