add draft? method to identify if Post is a draft #3456

Merged
merged 1 commit into from Feb 14, 2015

Conversation

Projects
None yet
4 participants
@willnorris
Contributor

willnorris commented Feb 14, 2015

This is useful in development scenarios where you are building with --drafts, and want to identify which posts are the drafts. As an example, I have a /drafts page that simply lists all of my current draft posts.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Feb 14, 2015

Member

Hey, thanks for the PR. Not a bad idea at all 👍 A little concerned about the ?.

@fw42 & @pushrax, is thing.draft? recommended/allowed syntax in Liquid 3 strict mode?

Member

parkr commented Feb 14, 2015

Hey, thanks for the PR. Not a bad idea at all 👍 A little concerned about the ?.

@fw42 & @pushrax, is thing.draft? recommended/allowed syntax in Liquid 3 strict mode?

@willnorris

This comment has been minimized.

Show comment
Hide comment
@willnorris

willnorris Feb 14, 2015

Contributor

yeah, fair point. I actually originally had it as is_draft, but thought that draft? was more idiomatic ruby. I don't have strong feelings either way.

Contributor

willnorris commented Feb 14, 2015

yeah, fair point. I actually originally had it as is_draft, but thought that draft? was more idiomatic ruby. I don't have strong feelings either way.

@pushrax

This comment has been minimized.

Show comment
Hide comment
@pushrax

pushrax Feb 14, 2015

? is allowed at the end of identifiers, however ! is not.

pushrax commented Feb 14, 2015

? is allowed at the end of identifiers, however ! is not.

parkr added a commit that referenced this pull request Feb 14, 2015

@parkr parkr merged commit 9b50fc9 into jekyll:master Feb 14, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request Feb 14, 2015

@willnorris willnorris deleted the willnorris:draft branch Feb 15, 2015

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