Skip to content

Commit d824fd8

Browse files
committed
Improve metadata for posts and pages (closes barryclark#50)
1 parent e29df68 commit d824fd8

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

_includes/meta.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<meta charset="utf-8" />
2+
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
3+
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
4+
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>
5+
6+
{% if page.excerpt %}
7+
<meta name="description" content="{{ page.excerpt| strip_html }}" />
8+
<meta property="og:description" content="{{ page.excerpt| strip_html }}" />
9+
{% else %}
10+
<meta name="description" content="{{ site.description }}">
11+
<meta property="og:description" content="{{ site.description }}" />
12+
{% endif %}
13+
<meta name="author" content="{{ site.name }}" />
14+
15+
{% if page.title %}
16+
<meta property="og:title" content="{{ page.title }}" />
17+
<meta property="twitter:title" content="{{ page.title }}" />
18+
{% endif %}

_layouts/default.html

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
7-
84
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>
95

10-
<meta name="author" content="{{ site.name }}" />
11-
<meta name="description" content="{{ site.description }}">
6+
{% include meta.html %}
127

138
<!--[if lt IE 9]>
149
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

0 commit comments

Comments
 (0)