From 5017c2a67603996de88e6c89ce7e5248af2cd948 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 9 Apr 2021 23:16:02 +0300 Subject: categories: list uncategorized posts too --- _includes/categories/categories.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to '_includes/categories') diff --git a/_includes/categories/categories.html b/_includes/categories/categories.html index 960423a..a988a3f 100644 --- a/_includes/categories/categories.html +++ b/_includes/categories/categories.html @@ -1,4 +1,7 @@ -{% if site.categories.size != 0 %} +{% if site.posts.size == 0 %} +

Sorry, no posts have been added yet.

+
+{% else %} {% for category in site.categories %}

{{ category[0] }}


@@ -8,7 +11,14 @@ {% endfor %} {% endfor %} -{% else %} -

Sorry, no posts have been added yet.

-
+ {% assign uncategorized = site.posts | where_exp: "post","post.categories.size == 0" %} + {% if uncategorized.size != 0 %} +

Other

+
+ + {% endif %} {% endif %} -- cgit v1.2.3