{%- assign tocNodes = hierarchy | where_exp:"item", "item.name == page.id" | map: "items" | first -%} {%- if tocNodes.size > 0 -%}

Table of contents

{%- assign sorted_nodes = tocNodes | sort_natural:"nav_order" -%} {%- endif -%}