Skip to content

Instantly share code, notes, and snippets.

@kennethormandy
Last active December 24, 2015 17:19
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 kennethormandy/6834953 to your computer and use it in GitHub Desktop.
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.
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.
{
"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