Instantly share code, notes, and snippets.

Embed
What would you like to do?
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