Skip to content

Instantly share code, notes, and snippets.

@rretsiem
Created September 19, 2014 18:05
Show Gist options
  • Save rretsiem/90c544cc6b77d6b8e87d to your computer and use it in GitHub Desktop.
Save rretsiem/90c544cc6b77d6b8e87d to your computer and use it in GitHub Desktop.
Octopress description and keyword meta tags
{% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
<meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" />
{% capture keywords %}{% if page.keywords %}{{ page.keywords }}{% elsif site.keywords %}{{ site.keywords }}{% endif %}{% endcapture %}
<meta name="keywords" content="{{ keywords | strip_html | condense_spaces }}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment