diff options
author | Frederic Hemberger <mail@frederic-hemberger.de> | 2011-09-21 10:08:38 +0200 |
---|---|---|
committer | Frederic Hemberger <mail@frederic-hemberger.de> | 2011-09-21 10:08:38 +0200 |
commit | 0b5215c0f5530e29810deb71e2a27042c3e1284b (patch) | |
tree | 80d840218990378112811610e02d81d823ec9230 /plugins | |
parent | 48a93a90a4b7a17e132f2b6ba80bbd5dbc1c99cb (diff) | |
download | my_new_personal_website-0b5215c0f5530e29810deb71e2a27042c3e1284b.tar.xz my_new_personal_website-0b5215c0f5530e29810deb71e2a27042c3e1284b.zip |
Adds first 150 chars of content as meta description, if no page.description specified. Fixes #162
Diffstat (limited to '')
-rw-r--r-- | plugins/octopress_filters.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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) + /.<div class="entry-content">(?<content>[\s\S]*?)<\/div>\s*<\/article>/ =~ input + return (content.nil?) ? input : content + end + # Replaces relative urls with full urls def expand_urls(input, url='') url ||= '/' |