Add a _drafts
folder as a sibling of _posts
. You add posts inside it the same way. To preview drafts, start jekyll with jekyll s --wD
. The D
is for Drafts.
Jekyll only allows one category per post. You can apply the category by front matter or subfolder, but subfolder never gets forgotten so it's recommended. If you need more than one "something" per post, create a separate front matter field:
---
tag:
-ruby
-bug
---
You can list by category, limit to the latest 2, or offset into a list:
<h2>Recent Blog Posts</h2>
<ul>
{% for post in site.categories.blog limit:2 %}
{% include li-post-summary.html %}
{% endfor %}
</ul>
<h2>More Posts</h2>
<ul>
{% for post in site.categories.blog offset:2 %}
{% include li-post-oneliner.html %}
{% endfor %}
</ul>
Best done with metadata. Put something like this in your post's front matter:
---
title: Javascript Dev Revisits the `C` programming language after 14 years
excerpt: I hadn't written a line of C since learning it in an AP community college class. Meow I'm back.
banner: http://simple.gy/img/apollo-13-eva-test.jpg
bannerCaption: "Photo Credit: http://unsplash.com"
---
And access it like this:
<div class="banner"
style="{% if page.banner %} background-image:url('{{page.banner}}'); {% endif %}"
>
Put an author id in your front matter:
---
author: foo42
---
Then describe authors in something like _config.yml
as in this post.
You use this in html like this:
{% assign author = site.authors[page.author] %}
<aside>
<img src="http://www.gravatar.com/avatar/{{ author.gravatar }}?s=40">
<span class="author">{{ author.display_name }}</span>
</aside>