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

make sure pages with published being false are not generated #1931

Merged
merged 1 commit into from Jan 22, 2014

Conversation

Projects
None yet
4 participants
@liufengyun
Contributor

liufengyun commented Jan 12, 2014

In the documentation it says published can be used both in page and post. But it's only effective in post.

This commit makes published front matter also effective for pages. It also refactors the current implementation of published feature.

@parkr

This comment has been minimized.

Member

parkr commented Jan 12, 2014

I'm cool with making the behaviour consistent between the two models. @mattr-, what do you think?

@ghost ghost assigned mattr- Jan 12, 2014

@liufengyun

This comment has been minimized.

Contributor

liufengyun commented Jan 17, 2014

@mattr- what do you think of this pull request?

@@ -21,6 +21,11 @@ def to_s
self.content || ''
end
# Helper methods to query boolean values specified in YAML frontmatter
%w(published).each do |key|
define_method("#{key}?") { !(self.data.has_key?(key) && self.data[key] == false) }

This comment has been minimized.

@mattr-

mattr- Jan 17, 2014

Member

Why do we have to implement this method this way? What prevents us from defining a normal method here?

This comment has been minimized.

@liufengyun

liufengyun Jan 17, 2014

Contributor

@mattr- I was thinking about later we may add similar methods to access boolean values in YAML front matter.

This comment has been minimized.

@liufengyun

liufengyun Jan 19, 2014

Contributor

@mattr- I think you're right here, it's bad to do over-design with inelegant code. I've updated the commit, please have a look.

@parkr

This comment has been minimized.

Member

parkr commented Jan 22, 2014

@mattr- When you get a minute, please review & merge if it looks good to you :)

@mattr-

This comment has been minimized.

Member

mattr- commented Jan 22, 2014

chuck-norris

mattr- added a commit that referenced this pull request Jan 22, 2014

@mattr- mattr- merged commit 9885783 into jekyll:master Jan 22, 2014

1 check passed

default The Travis CI build passed
Details

mattr- added a commit that referenced this pull request Jan 22, 2014

@liufengyun

This comment has been minimized.

Contributor

liufengyun commented Jan 22, 2014

Thanks @mattr- 👍

@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.