From ae22681f18aaf67abadde502767f4dd76906942e Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 4 Dec 2021 18:30:05 +0100 Subject: [PATCH] List all posts from given category --- templates/categories/single.html | 5 +++++ templates/macros.html | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/categories/single.html b/templates/categories/single.html index 09763b9..a8e59de 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -1 +1,6 @@ {% extends "index.html" %} + +{% block content %} +

{{ term.name }} category

+ {{ macros::list_posts(section=term, taxonomy=true) }} +{% endblock %} diff --git a/templates/macros.html b/templates/macros.html index 81158a0..053598a 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,5 +1,7 @@ -{% macro list_posts(section, count=0) %} - {% set section = get_section(path=section~"/_index.md") %} +{% macro list_posts(section, count=0, taxonomy=false) %} + {% if taxonomy == false %} + {% set section = get_section(path=section~"/_index.md") %} + {% endif %} {% for page in section.pages %} {% if loop.index > count and count != 0 %} {% break %}