From bda3537201f2e0b57e3b58d1d4885e727d5e2b24 Mon Sep 17 00:00:00 2001 From: Manan Date: Wed, 18 Apr 2018 04:13:26 +0530 Subject: [PATCH] Edit header.html to avoid listing coverstory articles under new articles --- _includes/header.html | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 0fded65..93633bd 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -36,14 +36,18 @@
New Articles
- {% for post in site.posts limit: 5 %} - - {% if forloop.index == 3 %} -
-
+ + {% assign counter = 0 %} + + {% for post in site.posts limit: 10 %} + {% if post.category == "coverstory" %} + {% continue %} {% endif %} - -
+ {% assign counter = counter | plus:1 %} + {% if counter > 5 %} + {% break %} + {% else %} +
@@ -51,17 +55,18 @@
- {% if forloop.index < 3 %} + {% if counter < 3 %}
{% if post.excerpt != null %}{{ post.excerpt | markdownify }}{% endif %}
{% endif %}
+ {% endif %} {% endfor %}