blob: 93bc4912fd0d1bce713d88245e7956504297b622 [file] [log] [blame]
{% assign p = '/toc-menu.json' %}
{% capture tocm_string %}{% readj p %}{% endcapture %}
{% jsonball tocm from var tocm_string %}
{% capture pagesiteurl %}{{ site.url }}{{ page.url }}{% endcapture %}
<ul id="mainmenu"><!-- INSERT LINKS -->
{% for x in tocm %}
{% capture ifactive %}
{% if pagesiteurl == x.file %}toc-active
{% else %}{% if x.children %}{% for x2 in x.children %}
{% if pagesiteurl == x2.file %}toc-active
{% else %}{% if x2.children %}{% for x3 in x2.children %}
{% if pagesiteurl == x3.file %}toc-active
{% else %}{% if x3.children %}{% for x4 in x3.children %}
{% if pagesiteurl == x4.file %}toc-active{% endif %}
{% endfor %}{% endif %}
{% endif %}
{% endfor %}{% endif %}
{% endif %}
{% endfor %}{% endif %}
{% endif %}
{% endcapture %}
{% capture ifactive %}{{ ifactive | trim }}{% endcapture %}
<li class="{{ifactive}}"><a href="{{ x.file }}">{{x.title}}</a></li>
{% endfor %}
</ul>