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

Add public_draft option for peer reviews. #170

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@vroy

vroy commented Oct 26, 2013

Adds a public_draft: true option for your YAML frontmatter so that your articles are always built but not available for listings in blog.articles

This is especially useful when you want to share an article for peer review while not listing it publicly on your index page or RSS feed, etc

Notes:

  • I will gladly open another pull request to update draft articles section of the guide if needed (uncertain about how you guys keep the docs and releases in sync though)
  • It is the first time that I write cucumber features and it was heavily cargo culted from the published-app features. Do let me know if you have any feedback about that.
  • Features are still all passing for me, but the 2 Gemfiles are a bit confusing. I only got them to pass if I point to Gemfile-3.0 like so: BUNDLE_GEMFILE=/Users/vincentroy8/code/middleman-blog/Gemfile-3.0 bundle exec rake test
Add public_draft option for peer reviews.
Adds a `public_draft: true` option for your YAML frontmatter so that
your articles are built but not available for listings in `blog.articles`
@bhollis

This comment has been minimized.

Member

bhollis commented Oct 26, 2013

Thanks for adding this, but do we really need a new first-class feature for public_draft? If you need something like this, can't you just filter articles in your templates?

@vroy

This comment has been minimized.

vroy commented Oct 26, 2013

Definitely an option. I personally don't see any use for published: false because I usually want to do some kind of peer review first. I thought it would be useful for other too (and again, I think it's a better option than published: false). Up to you if you want to bring it in or not, it won't hurt my feelings.

@epochwolf

This comment has been minimized.

Contributor

epochwolf commented Oct 28, 2013

The code looks good. This might be a useful feature. I have a lot of places I would need to filter the views to accomplish this. I don't think it's too complicated and it has a test to keep it from breaking.

My current workflow for reviews is just put the markdown in a secret gist and share the link. I let the html just hang out in the open since my reviewers know html. It might be nicer for them if they can see what is looks like on the blog.

@tdreyno

This comment has been minimized.

Member

tdreyno commented Oct 28, 2013

Seems like this could be reduced to a helper:

def non_draft_articles
  # env check if necessary
  blog.articles.reject{|a| a.data.public_draft }
end
@vroy

This comment has been minimized.

vroy commented Oct 28, 2013

Yeah, I'll move to using a helper. I honestly didn't realize there was helpers built in middleman and my head went right to: submit pull request to middleman-blog.

@vroy vroy closed this Oct 28, 2013

@vroy

This comment has been minimized.

vroy commented Oct 30, 2013

I went ahead and wrote a blog post about how I used an helper for public draft support in case anyone runs into this pull request in the future and are looking for a solution: http://vroy.ca/2013/10/30/how-to-do-peer-reviews-with-middleman-blog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment