Skip to content

Commit

Permalink
Improve metadata for posts and pages (closes #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryclark committed Mar 1, 2015
1 parent e29df68 commit d824fd8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
18 changes: 18 additions & 0 deletions _includes/meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<meta charset="utf-8" />
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>

{% if page.excerpt %}
<meta name="description" content="{{ page.excerpt| strip_html }}" />
<meta property="og:description" content="{{ page.excerpt| strip_html }}" />
{% else %}
<meta name="description" content="{{ site.description }}">
<meta property="og:description" content="{{ site.description }}" />
{% endif %}
<meta name="author" content="{{ site.name }}" />

{% if page.title %}
<meta property="og:title" content="{{ page.title }}" />
<meta property="twitter:title" content="{{ page.title }}" />
{% endif %}
7 changes: 1 addition & 6 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>

<meta name="author" content="{{ site.name }}" />
<meta name="description" content="{{ site.description }}">
{% include meta.html %}

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

0 comments on commit d824fd8

Please sign in to comment.