Fix social media metadata

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2024-09-07 13:31:24 +02:00
parent ef9e221f27
commit d9549668a4
+7 -7
View File
@@ -21,13 +21,13 @@
<meta property="og:url" content="{{ site.url | absolute_url }}" /> <meta property="og:url" content="{{ site.url | absolute_url }}" />
{% endif %} {% endif %}
<meta property="og:site_name" content="{{ site.title }}" /> <meta property="og:site_name" content="{{ site.title }}" />
<meta property="og:title" content="{{ page.autopages.display_name | default: page.autopage.display_name | default: page.title | default: site.title | strip_html }}" /> <meta property="og:title" content="{{ page.autopages.display_name | default: page.autopage.display_name | default: page.title | default: site.title | strip_html | xml_escape }}" />
{% if site.xaymar.opengraph.excerpt.enabled == true %} {% if site.xaymar.opengraph.excerpt.enabled == true %}
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncatewords: site.xaymar.opengraph.excerpt.length }}" /> <meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncatewords: site.xaymar.opengraph.excerpt.length | xml_escape }}" />
<meta property="og:description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncatewords: site.xaymar.opengraph.excerpt.length }}" /> <meta property="og:description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncatewords: site.xaymar.opengraph.excerpt.length | xml_escape }}" />
{% else %} {% else %}
<meta name="description" content="{{ site.description | strip_html }}" /> <meta name="description" content="{{ site.description | strip_html | xml_escape }}" />
<meta property="og:description" content="{{ site.description | strip_html }}" /> <meta property="og:description" content="{{ site.description | strip_html | xml_escape }}" />
{% endif %} {% endif %}
<meta property="og:type" content="{{ page.opengraph.type | default: "website" }}" /> <meta property="og:type" content="{{ page.opengraph.type | default: "website" }}" />
{% if page.opengraph.image != nil %} {% if page.opengraph.image != nil %}
@@ -43,9 +43,9 @@
{% endif %} {% endif %}
<meta property="article:published_time" content="{{ page.date | default: site.time | date_to_xmlschema }}" /> <meta property="article:published_time" content="{{ page.date | default: site.time | date_to_xmlschema }}" />
{% if page.title == nil %} {% if page.title == nil %}
<title>{{ site.title }} - {{ site.tagline }} </title> <title>{{ site.title | xml_escape }} - {{ site.tagline | xml_escape }} </title>
{% else %} {% else %}
<title>{{ page.autopages.display_name | default: page.autopage.display_name | default: page.title }} | {{ site.title }} - {{ site.tagline }} </title> <title>{{ page.autopages.display_name | default: page.autopage.display_name | default: page.title | xml_escape }} | {{ site.title | xml_escape }} - {{ site.tagline | xml_escape }} </title>
{% endif %} {% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="{{ site.xaymar.data.logo | absolute_url }}"> <link rel="icon" href="{{ site.xaymar.data.logo | absolute_url }}">