diff --git a/_includes/nav.html b/_includes/nav.html
index 976dbbd..325a68c 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -1,6 +1,5 @@
{% unless page.url == "/" %}
{% if page.parent %}
+ {%- for node in pages_list -%}
+ {%- if node.parent == nil -%}
+ {%- if page.parent == node.title or page.grand_parent == node.title -%}
+ {%- assign first_level_url = node.url | absolute_url -%}
+ {%- endif -%}
+ {%- if node.has_children -%}
+ {%- assign children_list = pages_list | where: "parent", node.title -%}
+ {%- for child in children_list -%}
+ {%- if page.url == child.url or page.parent == child.title -%}
+ {%- assign second_level_url = child.url | absolute_url -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- endif -%}
+ {%- endif -%}
+ {%- endfor -%}