{% assign pages_list2 = pages_list | sort:"nav2-weight" %} {% for node in pages_list2 %} {% if page.nav1 == node.nav1 and node.nav1-show != true and node.nav2-show == true %} {% if page.nav2 == node.nav2 %}