Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

This should hide draft posts. Except it doesn't.

  • Loading branch information...
commit 9c770654692efd7eec43a89e4c7688b1ea3919a9 1 parent 9fdf45e
@xiongchiamiov xiongchiamiov authored danielbeardsley committed
View
1  _posts/2012-07-20-hello-world.md
@@ -2,6 +2,7 @@
layout: with-comments
title: Hello, World!
author: James Pearson
+draft: true
---
Just sayin' hi for the moment.
View
10 archive/index.html
@@ -4,9 +4,11 @@
---
{% for page in site.posts %}
- <div class="date">
- {{ page.date | date: "%Y-%m-%d" }}
- </div>
- <a href="{{ page.url }}">{{ page.title }}</a><br />
+ {% unless page.draft %}
+ <div class="date">
+ {{ page.date | date: "%Y-%m-%d" }}
+ </div>
+ <a href="{{ page.url }}">{{ page.title }}</a><br />
+ {% endunless %}
{% endfor %}
View
20 index.html
@@ -3,15 +3,17 @@
---
{% for page in paginator.posts %}
-<div class="date">
- {{ page.date | date: "%Y-%m-%d" }}
-</div>
-<h2>
- <a href="{{ page.url }}">{{ page.title }}</a>
-</h2>
-{{ page.content | truncatewords: 130 }}
-<a href="{{ page.url }}">more</a>
-<br /><br />
+ {% unless page.draft %}
+ <div class="date">
+ {{ page.date | date: "%Y-%m-%d" }}
+ </div>
+ <h2>
+ <a href="{{ page.url }}">{{ page.title }}</a>
+ </h2>
+ {{ page.content | truncatewords: 130 }}
+ <a href="{{ page.url }}">more</a>
+ <br /><br />
+ {% endunless %}
{% endfor %}
<br /><br />
Please sign in to comment.
Something went wrong with that request. Please try again.