Adds first 150 chars of content as meta description, if no page.description specified. Fixes #162
This commit is contained in:
parent
48a93a90a4
commit
0b5215c0f5
2 changed files with 11 additions and 6 deletions
|
@ -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 ||= '/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue