-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Conversation
|
@benbalter Thoughts? |
|
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 == "") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
|
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? | |||
There was a problem hiding this comment.
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_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
|
👍 |
|
💥 test added. |
|
Test looks good! Thanks for doing that. |
Disable automatically-generated excerpts with option
Workaround for jekyll/jekyll#1380, jekyll/jekyll#1401. Should be reverted after jekyll/jekyll#1386 is released.
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)
If
excerpt_separatoris set to"", automatically-extracted excerpts are notgenerated and replaced with just an empty string.
Ref: #1380, #933, #837, #1339, #1302, #1033, #1321, #1307