From 9dc90333c1875a7ccef37aac0ae3a4f1e59c38a2 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 6 Aug 2013 18:05:15 +0200 Subject: [PATCH] Only generate excerpts if the excerpt_separator isn't blank --- lib/jekyll/post.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 9ad25399..86541b78 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -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