🐛 fix: close tags & set proper twitter:card value

This commit is contained in:
welpo 2023-09-03 22:03:41 +02:00
parent 2e75ac7b74
commit 1584e1ab4b
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6

View file

@ -51,33 +51,33 @@
<link rel="stylesheet" href="{{ get_url(path=stylesheet, cachebust=true) | safe }}" />
{%- endfor %}
<meta name="color-scheme" content="{%- if config.extra.theme_switcher -%}light dark{%- elif config.extra.default_theme -%}{{config.extra.default_theme}}{%- else -%}light{%- endif -%}">
<meta name="color-scheme" content="{%- if config.extra.theme_switcher -%}light dark{%- elif config.extra.default_theme -%}{{config.extra.default_theme}}{%- else -%}light{%- endif -%}" />
{%- if page.description %}
<meta name="description" content="{{ page.description | striptags | safe }}" />
<meta property="og:description" content="{{ page.description | striptags | safe }}">
<meta property="og:description" content="{{ page.description | striptags | safe }}" />
{%- elif page.summary %}
<meta name="description" content="{{ page.summary | striptags | safe | trim_end_matches(pat=".") }}" />
<meta property="og:description" content="{{ page.summary | striptags | safe | trim_end_matches(pat=".") }}">
<meta property="og:description" content="{{ page.summary | striptags | safe | trim_end_matches(pat=".") }}" />
{%- else %}
<meta name="description" content="{{ config.description }}" />
<meta property="og:description" content="{{ config.description }}">
<meta property="og:description" content="{{ config.description }}" />
{%- endif %}
{% if is_404 %}
<meta name="robots" content="noindex, follow">
<meta name="robots" content="noindex, follow" />
{% else %}
<meta name="robots" content="index, nofollow">
<meta name="robots" content="index, nofollow" />
{% endif %}
<meta property="og:title" content="{{ config.title }}">
<meta property="og:title" content="{{ config.title }}" />
<meta property="og:type" content="article" />
{# Image for social media sharing #}
{%- set social_media_card = macros_settings::evaluate_setting_priority(setting="social_media_card", page=page | default(value=""), default_global_value="") -%}
{% if social_media_card %}
<meta property="og:image" content="{{ get_url(path=social_media_card) }}">
<meta name="twitter:card" content="{{ get_url(path=social_media_card) }}">
<meta property="og:image" content="{{ get_url(path=social_media_card) }}" />
<meta name="twitter:card" content="summary_large_image" />
{% endif %}
{% set current_url = current_url | default(value="/") %}