{% from "macros/pagination.html" import render_pagination %} {% macro render_toc(toc, maxdepth=2) %} {% endmacro %} {% macro render_blog_post(post, show_toc=True) %}

{{ post.title }}

{% if post.publication_date %}
Posted:
{% else %} {% endif %} {% if post.updated_date and post.publication_date and (post.updated_date > post.publication_date) %}
Last updated:
{% endif %} {% if post.category %}
Category:
{% set category = site.get('/categories/'+post.category) %} {{ category.name }}
{% endif %}
{% if show_toc and post.render_toc %} {% set toc = post.body.toc|default([]) %} {{ render_toc(toc) }} {% endif %}
{{ post.body }}
{% if post.tags %} {% endif %}
{% endmacro %} {% macro render_blog_index(pagination) %} {% for post in pagination.items %} {{ render_blog_post(post, False) }} {% if not loop.last %}
{% endif %} {% endfor %} {% if pagination.pages > 1 %} {% endif %} {% endmacro %}