Created
October 30, 2013 11:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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