Last active
December 24, 2015 17:19
-
-
Save kennethormandy/6834953 to your computer and use it in GitHub Desktop.
A snippet for Harp. This is my first pass at showing draft posts locally but not in production.
This file contains hidden or 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
p “The environment is #{ environment }.” | |
ul | |
each article, slug in public.data | |
unless article.published===false && environment=="Production" | |
li | |
a(href="/articles/#{ slug }") #{ article.title } | |
//- Now, running the server locally will show | |
A Simple Blog and A Simple Article, but in | |
production, with the Harp Platform or using | |
`harp compile`, only A Simple Blog will appear. |
This file contains hidden or 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
{ | |
"a-simple-article": { | |
"title": "A Simple Article", | |
"published": false | |
}, | |
"a-simple-blog": { | |
"title": "A Simple Blog" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment