Skip to content

Commit f9a588a

Browse files
committed
added description content for meta description
1 parent fb967c5 commit f9a588a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.lektorproject

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ lektor-google-analytics = 0.1.3
1212
lektor-webpack-support = 0.5
1313
lektor-atom = 0.3
1414
lektor-disqus-comments = 0.4.1
15+
lektor-strip-html-tags = 0.3.1
16+
lektor-markdown-excerpt = 0.1

templates/layout.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
<link rel="stylesheet" href="{{ '/static/gen/style.css'|url }}">
88
<meta property="og:site_name" content="Creative Commons" />
99
<meta property="og:title" content="{{ this.title }}" />
10-
<meta property="og:description" content="" />
10+
{% if this.body %}
11+
{% set desc = this.body|excerpt|striphtmltags %}
12+
<meta property="og:description" content="{{ desc }}" />
13+
{% else %}
14+
{% set desc = this.description|striphtmltags %}
15+
<meta property="og:description" content="{{ desc }}" />
16+
{% endif %}
1117
<meta property="og:url" content="{{ this|url }}" />
1218
<meta property="og:type" content="article" />
1319
{% set image = this.attachments.images.first() %}
@@ -16,7 +22,7 @@
1622
{% endif %}
1723
<meta name="twitter:card" content="summary_large_image" />
1824
<meta name="twitter:title" content="{{ this.title }}">
19-
<meta name="twitter:description" content="">
25+
<meta name="twitter:description" content="{{ desc }}">
2026
{% if image %}
2127
<meta name="twitter:image" content="{{ image|url(external=true) }}">
2228
{% endif %}

0 commit comments

Comments
 (0)