aboutsummaryrefslogtreecommitdiff
path: root/templates/macros/create_stork_toml.html
blob: ee1d7653b2498812fe108fc0039df87a9e85c972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{%- macro from_section(section) -%}
{%- set section = get_section(path=section) -%}
{%- for post in section.pages -%}
{%- if not post.draft %}    {path = {{ '.' ~ post.path ~ 'index.html' | json_encode | safe }}, url = {{ post.permalink | json_encode | safe }}, title = {{ post.title | striptags | json_encode | safe }}}
{%- set found = true -%}
{%- if not loop.last -%},
{% endif -%}
{%- endif -%}
{%- endfor -%}
{%- if found and section.subsections -%},
{% for subsection in section.subsections -%}
{{ self::from_section(section=subsection) }}
{%- endfor -%}
{%- endif -%}
{%- endmacro from_section -%}