From da0f09076ee4a3a9c0598f1f58982a1993f5eab8 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Thu, 22 Jul 2021 23:50:50 +0300 Subject: add post count indicator to a tag page --- _layouts/tagsort.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/_layouts/tagsort.html b/_layouts/tagsort.html index 359484a..5dd20ec 100644 --- a/_layouts/tagsort.html +++ b/_layouts/tagsort.html @@ -4,6 +4,18 @@ layout: default

{{ page.tag }}

+{% capture nposts %} +{{ site.tags[page.tag] | size }} +{%- endcapture -%} +{%- capture nposts_mod10 -%} +{{ nposts | modulo: 10 }} +{%- endcapture -%} + + {{ nposts }} {% if nposts_mod10 == "1" %} post + {%- else -%} posts + {% endif %} + +
{% for post in site.tags[page.tag] %} {% include post-preview.html %} -- cgit v1.2.3