{% macro from(name, max=0) %} {% set s = get_section(path=name ~ "/_index.md") %} {{ self::from_section(s=s, max=max) }} {% endmacro %} {% macro from_pages(pages, max=0) %} {% set list = pages|reverse %} {% if max %}{% set list = list|slice(start=0, end=max) %}{% endif %} {% endmacro %} {% macro from_section(s, max=0) %} {% if s and s.pages|length > 0 %} {{ self::from_pages(pages=s.pages, max=max) }} {% endif %} {% endmacro %}