Skip to content

Commit 3fd8f8c

Browse files
committed
Descriptions now look sane -
1 parent 363458f commit 3fd8f8c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: _includes/layouts/common.liquid

+10-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@
2121
<meta name="og:site_name" property="og:site_name" content="Orionrobots" />
2222
<meta property="og:type" name="og:type" content="article" />
2323
<meta name="og:title" property="og:title" content="{{ title }} | {{ site_title }} - {{ site_tagline }}" />
24-
{% if description %}
25-
<meta name="og:description" property="og:description" content="{{ description }}" />
26-
{% endif %}
24+
{% capture real_description -%}
25+
{% if description -%}
26+
{{ description }}
27+
{%- else -%}
28+
{{ content | strip_html | strip_newlines | truncatewords: 50 }}
29+
{%- endif -%}
30+
{%- endcapture %}
31+
<meta name="og:description" property="og:description" content="{{ real_description }}" />
32+
<meta name="description" content="{{ real_description }}">
33+
2734
{% if thumbnail %}
2835
<meta name="og:image" property="og:image" content="{{ BASE_PATH }}/{% thumbnail_from_path thumbnail %}" />
2936
<meta name="twitter:image" content="{{ BASE_PATH }}/{% thumbnail_from_path thumbnail %}" />
@@ -34,11 +41,9 @@
3441

3542
<meta name="viewport" content="width=device-width, initial-scale=1">
3643
<title>{{ title }} | {{ site_title }} - {{ site_tagline }}</title>
37-
{% if description %}<meta name="description" content="{{ description }}">{% endif %}
3844
<meta name="author" content="{{ author | default: "Danny Staple"}}">
3945
<meta name="article:author" property="article:author" content="{{ author | default: "Danny Staple"}}">
4046

41-
4247
<script type="text/javascript" src="/dist/bundle.js"></script>
4348
{% capture css %}{% include css/bootstrap-style.css %}{% endcapture %}
4449
<style>{{ css | cssmin }}

0 commit comments

Comments
 (0)