Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable automatically-generated excerpts with option #1386

Merged
merged 8 commits into from
Aug 8, 2013
Merged

Conversation

parkr
Copy link
Member

@parkr parkr commented Aug 6, 2013

If excerpt_separator is set to "", automatically-extracted excerpts are not
generated and replaced with just an empty string.

Ref: #1380, #933, #837, #1339, #1302, #1033, #1321, #1307

@parkr
Copy link
Member Author

parkr commented Aug 6, 2013

@benbalter Thoughts?

@jneander
Copy link

jneander commented Aug 6, 2013

This one looks good to me. Disabling excerpts is a fair expectation when the separator is explicitly empty.

end

def should_generate_excerpt?
!(site.config['excerpt_separator'].to_s == "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!(site.config['excerpt_separator'].to_s.empty?) instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@parkr
Copy link
Member Author

parkr commented Aug 7, 2013

Need to add tests for this and then we're good. :D

@@ -255,7 +255,9 @@ def render(layouts, site_payload)
"page" => self.to_liquid(EXCERPT_ATTRIBUTES_FOR_LIQUID)
}.deep_merge(site_payload)

self.extracted_excerpt.do_layout(payload, {})
if should_generate_excerpt?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate_excerpt? instead?

Shorter, and seems more idiomatic to leave off the qualifiers such as is_ and should_

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

@benbalter
Copy link
Contributor

👍

@mattr-
Copy link
Member

mattr- commented Aug 8, 2013

💥 test added.

@parkr
Copy link
Member Author

parkr commented Aug 8, 2013

Test looks good! Thanks for doing that.

parkr added a commit that referenced this pull request Aug 8, 2013
Disable automatically-generated excerpts with option
@parkr parkr merged commit bc3dccf into master Aug 8, 2013
@parkr parkr deleted the disable-excerpts branch August 8, 2013 09:39
parkr added a commit that referenced this pull request Aug 8, 2013
SLaks added a commit to SLaks/SLaks.Blog that referenced this pull request Aug 9, 2013
Workaround for jekyll/jekyll#1380, jekyll/jekyll#1401.

Should be reverted after jekyll/jekyll#1386 is released.
parkr referenced this pull request Aug 23, 2013
After several page build fails, this seems to have fixed up the following error:

lib/jekyll/excerpt.rb:108:in `partition': type mismatch: NilClass given (TypeError)
@benbalter benbalter mentioned this pull request Jul 28, 2016
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants