diff options
Diffstat (limited to '_includes/categories/all.html')
-rw-r--r-- | _includes/categories/all.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/_includes/categories/all.html b/_includes/categories/all.html new file mode 100644 index 0000000..a988a3f --- /dev/null +++ b/_includes/categories/all.html @@ -0,0 +1,24 @@ +{% if site.posts.size == 0 %} + <p>Sorry, no posts have been added yet.</p> + <hr/> +{% else %} + {% for category in site.categories %} + <h1><a class="category" href="{{ '/' | relative_url }}{{ category[0] | slugify: 'pretty' }}/">{{ category[0] }}</a></h1> + <hr/> + <ul> + {% for post in category[1] %} + <li><a href="{{ post.url | relative_url }}">{{ post.date | date: "%Y-%m-%d" }} — {{ post.title }}</a></li> + {% endfor %} + </ul> + {% endfor %} + {% assign uncategorized = site.posts | where_exp: "post","post.categories.size == 0" %} + {% if uncategorized.size != 0 %} + <h1>Other</h1> + <hr/> + <ul> + {% for post in uncategorized %} + <li><a href="{{ post.url | relative_url }}">{{ post.date | date: "%Y-%m-%d" }} — {{ post.title }}</a></li> + {% endfor %} + </ul> + {% endif %} +{% endif %} |