{% macro typeof(thing) %} {% if thing is iterable %} {% if thing is object %} dict {% else %} list {% endif %} {% else %} {% if thing is string %} str {% elif thing is number %} num {% else %} other {% endif %} {% endif %} {% endmacro typeof %} {% macro render_article_summary(page) %}

{{ page.title }}

{% set d = page.date is defined %} {% set a = page.extra.author is defined %} {% set r = page.reading_time is defined %} {% if d or a or r %} {% if d %}{% if a %}, {% endif %}{% endif %}{% if a %}by {{ page.extra.author }}{% endif %} {% if page.reading_time %}{{ page.reading_time }} minute read{% endif %} {% endif %} {% if page.summary %} {% if config.extra.summary_max_length %} {{ page.summary | safe | truncate(length=config.extra.summary_max_length) }} {% else %} {{ page.summary | safe }} {% endif %} {% endif %} {% endmacro render_article_summary %} {% macro toc(page) %} {% endmacro toc %} {% macro debug(thing, label="", recurse=0) %} {% set type = self::typeof(thing=thing) | trim %} {% if label %}{{ label }}: {% endif %}{{ type }} {% set rdepth = recurse - 1 %}
{% if type == "dict" %} {% for k, v in thing %} {% if v is iterable and recurse %} {{ k }}: {{ self::debug(thing=v, recurse=rdepth) }} {% else %} {{ k }}: {{ v }}
{% endif %} {% endfor %} {% elif type == "list" %} {% for v in thing %} {% if v is iterable and recurse %} {{ self::debug(thing=v, recurse=rdepth) }} {% else %} {{ v }}
{% endif %} {% endfor %} {% else %} {{ thing }} {% endif %}
{% endmacro debug %} {% macro parent_tree(ancestors) %}
{% for sect in ancestors %} {% set sect = get_section(path=sect) %} {{ sect.title }}/ {% endfor %}
{% endmacro section_tree %} {% macro subsection_tree(subs) %} {% endmacro subsection_tree %}