Skip to content

Latest commit

 

History

History
23 lines (22 loc) · 713 Bytes

File metadata and controls

23 lines (22 loc) · 713 Bytes

{# Global "index" variable for page-wide numbering of tasks #} {# (In Jinja we need to store the variable in a "namespace") #} {% set global = {'index': 0} %}

    {% for task in data.tasks %} {% if 'section' in task %}
{% if global.index %}
{% endif -%} {% if 'markdown' in task.section -%}
{{ task.section.markdown | markdown }}
{% endif %}
    {% else %}
  1. {{ task.markdown | markdown }}
  2. {% set _ = global.update(index = global.index + 1) %} {% endif %} {% endfor %}