Added dynamic non-JS submenu

* closes #6

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-12-24 22:49:36 +01:00
parent 90f5f0e5f4
commit b441310087
3 changed files with 62 additions and 20 deletions

View File

@ -3,7 +3,17 @@
{% include head.html %}
<body>
{% assign showSubmenu = false %}
{% for item in site.data.header-menu.items %}
{% if item.items %}
{% if page.url == item.link %}
{% assign showSubmenu = true %}
{% elsif page.parent_link == item.link %}
{% assign showSubmenu = true %}
{% endif %}
{% endif %}
{% endfor %}
<body class="{% if showSubmenu %}submenu{% endif %}">
{% include header.html %}
<div class="container">
<div class="row">