1
0

List all posts from given category

This commit is contained in:
Emil Miler 2021-12-04 18:30:05 +01:00
parent 194fcc5b92
commit ae22681f18
2 changed files with 9 additions and 2 deletions

View File

@ -1 +1,6 @@
{% extends "index.html" %}
{% block content %}
<h1>{{ term.name }} category</h1>
{{ macros::list_posts(section=term, taxonomy=true) }}
{% endblock %}

View File

@ -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 %}