Skip to content

Commit 8065189

Browse files
committed
docs: add continuity manifesto and improve social metadata
1 parent f341095 commit 8065189

2 files changed

Lines changed: 378 additions & 10 deletions

File tree

_includes/metadata.liquid

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,44 @@
4949
{% endunless %}
5050
{% endif %}
5151

52+
{% if page.description %}
53+
{% assign meta_description = page.description | strip_html | strip_newlines | normalize_whitespace %}
54+
{% elsif page.excerpt %}
55+
{% assign meta_description = page.excerpt | strip_html | strip_newlines | normalize_whitespace %}
56+
{% else %}
57+
{% assign meta_description = site.description | strip_html | strip_newlines | normalize_whitespace %}
58+
{% endif %}
59+
60+
{% if page.og_image %}
61+
{% assign social_image = page.og_image | absolute_url %}
62+
{% elsif site.og_image %}
63+
{% assign social_image = site.og_image | absolute_url %}
64+
{% endif %}
65+
66+
{% if page.title and page.url != '/' %}
67+
{% capture social_title %}{{ page.title }} | {{ title }}{% endcapture %}
68+
{% else %}
69+
{% assign social_title = title %}
70+
{% endif %}
71+
5272
{% if site.serve_og_meta %}
5373
<!-- OpenGraph -->
54-
<meta property="og:site_name" content="{{ title }}">
74+
<meta property="og:site_name" content="{{ site.title }}">
5575
<meta property="og:type" content="{% if is_blog_post %}article{% else %}website{% endif %}">
56-
<meta property="og:title" content="{% if page.title %}{{ title }} | {{ page.title }}{% else %}{{ title }}{% endif %}">
76+
<meta property="og:title" content="{{ social_title }}">
5777
<meta property="og:url" content="{{ page.url | prepend: site.baseurl | prepend: site.url | remove_first: 'index.html' }}">
58-
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
59-
{% if page.og_image or site.og_image %}
60-
<meta property="og:image" content="{% if page.og_image %}{{ page.og_image }}{% else %}{{ site.og_image }}{% endif %}">
78+
<meta property="og:description" content="{{ meta_description }}">
79+
{% if social_image %}
80+
<meta property="og:image" content="{{ social_image }}">
6181
{% endif %}
6282
<meta property="og:locale" content="{{ site.lang }}">
6383

6484
<!-- Twitter card -->
65-
<meta name="twitter:card" content="summary">
66-
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ title }}{% endif %}">
67-
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
68-
{% if page.og_image or site.og_image %}
69-
<meta name="twitter:image" content="{% if page.og_image %}{{ page.og_image }}{% else %}{{ site.og_image }}{% endif %}">
85+
<meta name="twitter:card" content="{% if social_image %}summary_large_image{% else %}summary{% endif %}">
86+
<meta name="twitter:title" content="{{ social_title }}">
87+
<meta name="twitter:description" content="{{ meta_description }}">
88+
{% if social_image %}
89+
<meta name="twitter:image" content="{{ social_image }}">
7090
{% endif %}
7191
{% if site.x_username %}
7292
<meta name="twitter:site" content="@{{ site.x_username }}">

0 commit comments

Comments
 (0)