From 194fcc5b928822ad1572d06f64167cc73b4c4455 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 4 Dec 2021 18:20:01 +0100 Subject: [PATCH] More universal macro for listing posts --- templates/index.html | 2 +- templates/macros.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/index.html b/templates/index.html index bbcfc11..333aa65 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,7 +21,7 @@
{% block content %} - {{ macros::posts_latest(section="posts", count=config.extra.latest_posts_count) }} + {{ macros::list_posts(section="posts", count=config.extra.latest_posts_count) }} {% endblock %}
diff --git a/templates/macros.html b/templates/macros.html index 60ab181..81158a0 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,7 +1,7 @@ -{% macro posts_latest(section, count) %} +{% macro list_posts(section, count=0) %} {% set section = get_section(path=section~"/_index.md") %} {% for page in section.pages %} - {% if loop.index > count %} + {% if loop.index > count and count != 0 %} {% break %} {% endif %} {{ macros::print_article(page=page) }}