pebble/devsite/source/_includes/docs/menu.html
2025-02-24 18:58:29 -08:00

47 lines
1.8 KiB
HTML

{% comment %}
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}
<ul>
{% for group in include.tree %}
{% if page.docs_language == 'pebblekit_ios' %}
{% assign open = true %}
{% elsif include.group.path contains group.name %}
{% assign open = true %}
{% else %}
{% assign open = false %}
{% endif %}
{% if group.children.size > 0 %}
<li class="section-menu__item{% if open == true %} open{% if include.group.path.last == group.name %} active{% endif %}{% endif %}">
<a href="{{ group.url }}">{{ group.name }}</a>
<ul>
{% for item in group.children %}
<li class="section-menu__subitem{% if include.group.path contains item.name %} open{% if include.group.path.last == item.name %} active{% endif %}{% endif %}">
<a href="{{ item.url }}"><span>{{ item.name }}</span></a>
{% if item.children.size > 0 %}
<ul>
{% for child in item.children %}
{% capture full_url %}{{ child.url }}index.html{% endcapture %}
<li class="section-menu__subsubitem{% if page.url == full_url %} active{% endif %}"><a href="{{ child.url }}"><span>{{ child.name }}</span></a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>