ws-begerad-11ty/src/_includes/partials/meta-info.html

61 lines
1.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
SPDX-FileCopyrightText: 2021 Software Ingenieur Begerad <swingbe.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
{% set pageTitle = title + ' - ' + site.name %}
<!--We don't want any duplication. This is likely for the home page.-->
{% if site.name === title %}
{% set pageTitle = title %}
{% endif %}
{% set siteTitle = site.name %}
{% set siteOrg = site.organization.name %}
{% set currentUrl = site.url + page.url %}
<!--If the pages Front Matter has specific metaTitle and/or metaDesc items, switch them into the mix.-->
{% if metaTitle %}
{% set pageTitle = metaTitle %}
{% endif %}
{% if not metaDesc %}
{% set metaDesc = summary %}
{% endif %}
<link rel="canonical" href="{{ currentUrl }}" />
<!--set meta-->
<meta charset="utf-8">
<!--Always include the viewport <meta> tag inside the <head> section of your document to enable touch zooming and ensure proper rendering on mobile devices.-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:site_name" content="{{ siteTitle }}" />
<meta property="og:title" content="{{ pageTitle }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ currentUrl }}" />
{% if socialImage %}
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:image" content="{{ socialImage }}" />
<meta name="twitter:image" content="{{ socialImage }}" />
<meta property="og:image:alt" content="Page image for {{ site.name }}" />
<meta name="twitter:image:alt" content="Page image for {{ site.name }}" />
{% endif %}
{% if metaDesc %}
<meta name="description" content="{{ metaDesc }}" />
<meta name="twitter:description" content="{{ metaDesc }}" />
<meta property="og:description" content="{{ metaDesc }}" />
{% endif %}
{% if metaKey %}
<meta name="keywords" content="{{ metaKey }}" />
{% endif %}
<meta name="author" content="{{ siteOrg }}">
<title>{{ pageTitle }}</title>