diff --git a/.themes/classic/source/_includes/head.html b/.themes/classic/source/_includes/head.html
index be371e9..5d81765 100644
--- a/.themes/classic/source/_includes/head.html
+++ b/.themes/classic/source/_includes/head.html
@@ -6,18 +6,16 @@
{% if page.title %}{{page.title}} - {% endif %}{{site.title}}
- {% if page.description %}
-
- {% endif %}
+
+ {% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
+
+ {% if page.keywords %}{% endif %}
- {% if page.keywords %}
-
- {% endif %}
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb
index 1a95989..bade7e4 100644
--- a/plugins/octopress_filters.rb
+++ b/plugins/octopress_filters.rb
@@ -56,6 +56,13 @@ module OctopressLiquidFilters
end
end
+ # Extracts raw content DIV from template, used for page description as {{ content }}
+ # contains complete sub-template code on main page level
+ def raw_content(input)
+ /.(?[\s\S]*?)<\/div>\s*<\/article>/ =~ input
+ return (content.nil?) ? input : content
+ end
+
# Replaces relative urls with full urls
def expand_urls(input, url='')
url ||= '/'