{% macro sectionlisting(section) %} {{ self::postlist(section=section) }}
{% endmacro postlisting %} {% macro postlisting(posts) %} {% for post in posts %} {{ self::display_post(post=post) }} {% endfor %}
{% endmacro postlisting %} {% macro postlist(section) %} {% set post_paths = self::recursive_visit(section=section) %} {% set_global posts = [] %} {% for path in post_paths | split(pat="&") %} {% set clean_path = path | trim %} {% if clean_path == "" %}{% continue %}{% endif %} {% set post = get_page(path=clean_path) %} {% set_global posts = posts | concat(with=post) %} {% endfor %} {% for post in posts | sort(attribute="date") | reverse %} {{ self::display_post(post=post) }} {% endfor %} {% endmacro %} {% macro recursive_visit(section) %} {% if section.extra.include_posts == true %} {% for page in section.pages %}{{ page.relative_path }}&{% endfor %} {% for sub in section.subsections %} {{ self::recursive_visit(section=get_section(path=sub)) }} {% endfor %} {% endif %} {% endmacro %} {% macro display_post(post) %} {% if not post.draft %} {{ post.title }}
{{ post.reading_time }} min read - Posted {% if post.extra.author %}by {{ post.extra.author }}{% endif %} on {{ post.date }} {% if post.tags %} {{ post.tags | join(sep=", ") }} {% endif %} {% endif %} {% endmacro %}