Only generate excerpts if the excerpt_separator isn't blank

This commit is contained in:
Parker Moore 2013-08-06 18:05:15 +02:00
parent 9193f5ea60
commit 9dc90333c1
1 changed files with 12 additions and 2 deletions

View File

@ -255,7 +255,9 @@ module Jekyll
"page" => self.to_liquid(EXCERPT_ATTRIBUTES_FOR_LIQUID)
}.deep_merge(site_payload)
self.extracted_excerpt.do_layout(payload, {})
if should_generate_excerpt?
self.extracted_excerpt.do_layout(payload, {})
end
do_layout(payload.merge({"page" => self.to_liquid}), layouts)
end
@ -309,7 +311,15 @@ module Jekyll
protected
def extract_excerpt
Jekyll::Excerpt.new(self)
if should_generate_excerpt?
Jekyll::Excerpt.new(self)
else
""
end
end
def should_generate_excerpt?
site.config['excerpt_separator'].to_s != ""
end
end
end