diff --git a/_includes/nav.html b/_includes/nav.html
index 45c83d5..93dcf21 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -29,7 +29,7 @@
{%- endif -%}
{{ child.title }}
{%- if child.has_children -%}
- {%- assign grand_children_list = pages_list | where: "parent", child.title -%}
+ {%- assign grand_children_list = pages_list | where: "parent", child.title | where: "grand_parent", node.title -%}
{%- for grand_child in grand_children_list -%}
-
diff --git a/_layouts/default.html b/_layouts/default.html
index 32d149b..4ab8693 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -83,8 +83,9 @@ layout: table_wrappers
Table of contents
- {% for child in pages_list %}
- {% if child.parent == page.title and child.title != page.title %}
+ {%- assign children_list = pages_list | where: "parent", node.title -%}
+ {% for child in children_list %}
+ {% if child.parent == page.title and child.title != page.title and child.grand_parent == page.parent %}
-
{{ child.title }}{% if child.summary %} - {{ child.summary }}{% endif %}