Simplify and organize _config.yml variables

This commit is contained in:
Michael Rose
2014-07-31 09:37:41 -04:00
parent f4869f79c4
commit 1a3231f506
21 changed files with 175 additions and 140 deletions

View File

@@ -1,62 +1,21 @@
<meta charset="utf-8">
<title>{% if page.title %}{{ page.title }} &#8211; {% endif %}{{ site.title }}</title>
<meta name="description" content="{{ page.description }}">
{% if page.excerpt %}<meta name="description" content="{{ page.excerpt | strip_html }}">{% endif %}
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
{% if site.owner.twitter %}<!-- Twitter Cards -->
{% if page.image.feature %}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content=
{% if page.image.feature contains 'http://' %}
"{{ page.image.feature }}"
{% elsif page.image.feature contains 'https://' %}
"{{ page.image.feature }}"
{% else %}
"{{ site.url }}/images/{{ page.image.feature }}"
{% endif %}
>
{% else %}
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content=
{% if page.image.thumb %}
{% if page.image.thumb contains 'http://' %}
"{{ page.image.thumb }}"
{% elsif page.image.thumb contains 'https://' %}
"{{ page.image.thumb }}"
{% else %}
"{{ site.url }}/images/{{ page.image.thumb }}"
{% endif %}
{% else %}
{% if site.logo contains 'http://' %}
"{{ site.logo }}"
{% elsif site.logo contains 'https://' %}
"{{ site.logo }}"
{% else %}
"{{ site.url }}/images/{{ site.logo }}"
{% endif %}
{% endif %}
>
{% endif %}
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">
{% if page.author %}
{% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.owner %}
{% endif %}
<!-- Open Graph -->
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:site_name" content="{{ site.title }}">
{% include _open-graph.html %}
{% if site.google_verify %}<!-- Webmaster Tools verfication -->
<meta name="google-site-verification" content="{{ site.google_verify }}">{% endif %}
{% if site.bing_verify %}<meta name="msvalidate.01" content="{{ site.bing_verify }}">{% endif %}
{% if site.owner.google.verify %}<!-- Webmaster Tools verfication -->
<meta name="google-site-verification" content="{{ site.owner.google.verify }}">{% endif %}
{% if site.owner.bing-verify %}<meta name="msvalidate.01" content="{{ site.owner.bing-verify }}">{% endif %}
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
<link rel="canonical" href="{{ canonical }}">
<link href="{{ site.url }}/feed.xml" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
{% if site.owner.google_plus %}<link rel="author" href="http://plus.google.com/+{{ site.owner.google_plus }}?rel=author">{% endif %}
{% if site.owner.google.plus %}<link rel="author" href="http://plus.google.com/+{{ site.owner.google.plus }}?rel=author">{% endif %}
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">