From 209ac7be7db196dec85c5d0698189bf1f49a4488 Mon Sep 17 00:00:00 2001
From: Peter Mosses <p.d.mosses@tudelft.nl>
Date: Thu, 22 Aug 2019 21:45:09 +0200
Subject: [PATCH] Update nav.html

Restrict navigation to display only direct children.
---
 _includes/nav.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/_includes/nav.html b/_includes/nav.html
index 1c1dd2b7..fdcf1e13 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -20,6 +20,7 @@
                     {%- endif -%}
                     <a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
                     {%- if child.has_children -%}
+                    {%- if page.url == child.url or page.parent == child.title -%}
                         {%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
                         <ul class="navigation-list-child-list">
                         {%- for grand_child in grand_children_list -%}
@@ -29,6 +30,7 @@
                         {%- endfor -%}
                       </ul>
                     {%- endif -%}
+                    {%- endif -%}
                   </li>
                 {%- endfor -%}
               </ul>
-- 
GitLab