Kathryn Grayson Nanz b872dbe384
Add new front matter element: excerpt (#227)
* This commit adds the excerpt front matter element, to show an
abbreviated version of the definition in social previews. This
also includes the documentation updates to support this change.

* This commit adds @olvb's suggestion to use 'set' to define the
alert & preview combo, to avoid repetitive code

* This commit updates the preview text to only include the flag if
it's "avoid" – if the flag is "warning" or there is no flag, it
will not appear at the beginning of the preview text.

Co-authored-by: Kathryn Grayson Nanz <kathryn@Kathryns-MacBook-Air.local>
Co-authored-by: Oscar <ovlb@users.noreply.github.com>
Co-authored-by: Kathryn <>
2020-08-24 19:41:45 +02:00

64 lines
2.2 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 '' %}
{% if flag.level == "avoid" %}
{% set alert = flag.level + ": " %}
{% else %}
{% set alert = '' %}
{% endif %}
{% set preview = excerpt or renderData.description or description or metadata.description %}
{% set fullExcerpt = alert + preview %}
<title>{{ pageTitle + metadata.title }}</title>
<meta
name="twitter:description"
content="{{ fullExcerpt }}"
>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="{{ pageTitle }}"/>
<meta
name="og:description"
content="{{ fullExcerpt }}"
>
<meta name="og:title" content="{{ pageTitle }}"/>
<meta
name="description"
content="{{ fullExcerpt }}"
>
<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 %}
<footer class="site-footer">
<nav aria-label="Complimentary">
<ul class="navigation-list">
<li>
<a href="/documentation/">Documentation</a>
</li>
<li>
<a href="/content-warning-guidelines/">Content Warning Guidelines</a>
</li>
<li>
<a href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}">RSS Feed</a>
</li>
</ul>
</nav>
</footer>
{% block pageScript %}
{% endblock pageScript %}
</body>
</html>