mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-10 21:01:41 +00:00
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>
This commit is contained in:
@ -10,29 +10,23 @@
|
||||
{# 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 }}"
|
||||
content="{% metaDescriptionWithFlag preview, flag %}"
|
||||
>
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:title" content="{{ pageTitle }}"/>
|
||||
<meta
|
||||
name="og:description"
|
||||
content="{{ fullExcerpt }}"
|
||||
content="{% metaDescriptionWithFlag preview, flag %}"
|
||||
>
|
||||
<meta name="og:title" content="{{ pageTitle }}"/>
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ fullExcerpt }}"
|
||||
content="{% metaDescriptionWithFlag preview, flag %}"
|
||||
>
|
||||
<link rel="stylesheet" href="https://use.typekit.net/qlo3dpu.css">
|
||||
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
|
||||
|
Reference in New Issue
Block a user