Derek Murr 7aed7e3b90
Include flag context in excerpt (#294)
* Added avoid flag text to meta descriptions

* Moved meta description logic to a shortcode

* Fixing nunjucks syntax error in base template head

Co-authored-by: Oscar <ovlb@users.noreply.github.com>
2020-09-01 21:39:23 +02:00

45 lines
1.7 KiB
Plaintext

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://use.typekit.net/" crossorigin>
<link rel="dns-prefetch" href="https://use.typekit.net/">
<link rel="preconnect" href="https://p.typekit.net/" crossorigin>
<link rel="dns-prefetch" href="https://p.typekit.net/">
{# Use title with path, or append a space to the page title to avoid collpasing with the meta title #}
{% set pageTitle = titleWithPath or title + ' ' or '' %}
{% set preview = excerpt or renderData.description or description or metadata.description %}
<title>{{ pageTitle + metadata.title }}</title>
<meta
name="twitter:description"
content="{% metaDescriptionWithFlag preview, flag %}"
>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="{{ pageTitle }}"/>
<meta
name="og:description"
content="{% metaDescriptionWithFlag preview, flag %}"
>
<meta name="og:title" content="{{ pageTitle }}"/>
<meta
name="description"
content="{% metaDescriptionWithFlag preview, flag %}"
>
<link rel="stylesheet" href="https://use.typekit.net/qlo3dpu.css">
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
<link rel="alternate" type="application/atom+xml" href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}">
{% block pageStyles %}
{% endblock pageStyles %}
</head>
<body>
{% block content %}{% endblock content %}
{% include 'components/base/site-footer.njk' %}
{% block pageScript %}
{% endblock pageScript %}
</body>
<script defer src="/js/theme-switcher.js"></script>
</html>