mirror of
https://github.com/TomHodson/tomhodson.github.com.git
synced 2025-06-26 10:01:18 +02:00
put draft posts at the top
This commit is contained in:
parent
f063d0394a
commit
6d6358b6a7
14
blog.md
14
blog.md
@ -14,8 +14,16 @@ img:
|
||||
<span class="dt-label">Date Posted</span>
|
||||
</section>
|
||||
<hr class="heading">
|
||||
{% for post in site.posts %}
|
||||
{% if post.draft == false or jekyll.environment == "development" %}
|
||||
|
||||
{% assign draft_posts = site.posts | where: "draft", "true" %}
|
||||
{% assign published_posts = site.posts | where: "draft", "false" %}
|
||||
|
||||
{% if jekyll.environment == 'development' %}
|
||||
{% for post in draft_posts %}
|
||||
{% include post_summary.html %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% for post in published_posts limit:5 %}
|
||||
{% include post_summary.html %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
@ -24,13 +24,17 @@ Welcome to my little home on the web! Below you'll find recent blog posts, proje
|
||||
</section>
|
||||
|
||||
<hr class="heading">
|
||||
|
||||
{% assign draft_posts = site.posts | where: "draft", "true" %}
|
||||
{% assign published_posts = site.posts | where: "draft", "false" %}
|
||||
|
||||
{% if jekyll.environment == 'development' %}
|
||||
{% assign filtered_posts = site.posts %}
|
||||
{% else %}
|
||||
{% assign filtered_posts = site.posts | where: "draft", "false" %}
|
||||
{% for post in draft_posts %}
|
||||
{% include post_summary.html %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% for post in filtered_posts limit:5 %}
|
||||
{% for post in published_posts limit:5 %}
|
||||
{% include post_summary.html %}
|
||||
{% endfor %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user