Skip to content

Commit 3993ee9

Browse files
committed
Updated support for drafts
1 parent 2c1f896 commit 3993ee9

File tree

5 files changed

+50
-9
lines changed

5 files changed

+50
-9
lines changed

Diff for: _layouts/post.html

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<div class="post">
66
<h1 class="post-title">{{ page.title }}</h1>
77
<span class="post-date">{{ page.date | date_to_string }}&nbsp;{% if page.tags != empty %} <div class="tag-icon-image"> {% for tag in page.tags %} <div class="tag-link"><a href="{{ site.baseurl }}/tags#{{ tag }}&tag={{ tag | uri_escape }}">{{ tag }}</a></div> {% endfor %}</div>{% endif %}</span><div class="floatright"><a href="https://twitter.com/share" class="twitter-share-button" data-via="hamishwillee">Tweet</a><div class="g-plusone" data-size="medium" data-annotation="bubble" data-width="120"></div></div>
8+
{% if page.tags contains 'draft' %}<div class="message">DRAFT - This blog post is <b>under construction</b>.</div> {% endif %}
89
{{ content }}
910
</div>
1011
<!-- add commenting -->
@@ -33,3 +34,6 @@ <h3>
3334
</div>
3435
3536
-->
37+
38+
39+

Diff for: _posts/2014-06-05-Example-draft--blog.markdown

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: post
3+
title: "Example draft blog"
4+
tags:
5+
- jekyll
6+
- draft
7+
---
8+
9+
This is an example draft blog.
10+
11+
It has been created so I can test draft support on my Jekyll blog.
12+
13+

Diff for: blogs.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ rss: true
55
permalink: /blog/
66
---
77

8-
<div class="posts">
8+
<div class="posts">
99
<ul>
1010
{% for post in site.posts %}
11-
<!-- <div class="post-block"> -->
12-
11+
{% if post.tags contains 'draft' %}<!--do nothing -->{% else %}
1312
<li> <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a><span class="small-post-date"> - {{ post.date | date: "%b %-d, %Y" }}</span>
1413
{% if post.tags != empty %} <div class="tag-icon-image"> {% for tag in post.tags %} <div class="tag-link"><a href="{{ site.baseurl }}/tags#{{ tag }}&tag={{ tag | uri_escape }}">{{ tag }}</a></div> {% endfor %}</div>{% endif %}
15-
<!-- </div> --></li> {% endfor %} </ul></div>
14+
<!-- </div> --></li>
15+
{% endif %}
16+
{% endfor %}
17+
</ul></div>
18+
19+
20+
21+
22+
23+
1624

1725

1826

Diff for: index.html

+14-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@
1515
<h2>Latest from the blog</h2>
1616

1717
{% for post in site.posts limit:5 %}
18-
<div class="post-block">
19-
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a><span class="small-post-date"> - {{ post.date | date: "%b %-d, %Y" }}</span>
20-
{% if post.tags != empty %} <div class="tag-icon-image"> {% for tag in post.tags %} <div class="tag-link"><a href="{{ site.baseurl }}/tags#{{ tag }}&tag={{ tag | uri_escape }}">{{ tag }}</a></div> {% endfor %}</div>{% endif %}
21-
<div class="post-excerpt">{{ post.excerpt }}</div>
22-
</div> {% endfor %}
18+
{% if post.tags contains 'draft' %}<!--do nothing -->{% else %}
19+
2320

21+
<div class="post-block">
22+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a><span class="small-post-date"> - {{ post.date | date: "%b %-d, %Y" }}</span>
23+
{% if post.tags != empty %} <div class="tag-icon-image"> {% for tag in post.tags %} <div class="tag-link"><a href="{{ site.baseurl }}/tags#{{ tag }}&tag={{ tag | uri_escape }}">{{ tag }}</a></div> {% endfor %}</div>{% endif %}
24+
<div class="post-excerpt">{{ post.excerpt }}</div>
25+
</div>
2426

27+
{% endif %}
28+
{% endfor %}
2529
</div>
30+
31+
32+
33+
34+

Diff for: startup

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ git commit -m "your comment"
77
git push
88

99

10+
git reset --hard master
11+
12+
1013
<!-- Text for getting page lists -->
1114
<!--
1215
{% for page in site.pages %}
@@ -16,3 +19,7 @@ git push
1619

1720
http://nicolashery.com/fast-mobile-friendly-website-with-jekyll
1821

22+
23+
24+
25+

0 commit comments

Comments
 (0)