Skip to content

Instantly share code, notes, and snippets.

@vroy
Created October 30, 2013 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vroy/7231475 to your computer and use it in GitHub Desktop.
Save vroy/7231475 to your computer and use it in GitHub Desktop.
Public draft helpers for middleman-blog. See also: http://vroy.ca/2013/10/30/how-to-do-peer-reviews-with-middleman-blog.html
module PublicDraftHelpers
def published(articles)
if development?
articles
else
articles.reject{|a| a.data.public_draft }
end
end
def sitemap_resources
sitemap.resources.reject{|p| p.data.public_draft }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment