From 0b5215c0f5530e29810deb71e2a27042c3e1284b Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Wed, 21 Sep 2011 10:08:38 +0200 Subject: Adds first 150 chars of content as meta description, if no page.description specified. Fixes #162 --- plugins/octopress_filters.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins') diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index 1a959892..bade7e49 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 ||= '/' -- cgit v1.2.1