istio.io/_includes/doc-side-nav.html

42 lines
1.2 KiB
HTML

<ul class="doc-side-nav">
{% assign components = page.path | downcase | split: '/' %}
{% assign section = components[1] %}
{% assign foundSection = false %}
{% assign docs = site.docs %}
{% for d in docs %}
{% assign components = d.path | downcase | split: '/' %}
{% if components[1] == section %}
{% if components[2] == 'index.md' %}
{% assign foundSection = true %}
<li><h5 class='doc-side-nav-title'>{{d.title}}</h5></li>
{% endif %}
{% endif %}
{% endfor %}
{% if foundSection == true %}
<script type="text/javascript">
var docs = [];
{% for d in docs %}
{% assign components = d.path | downcase | split: '/' %}
{% if components[1] == section %}
docs.push({path: [
{% for comp in components %}
{% if forloop.index > 2 %}
"{{ comp }}",
{% endif %}
{% endfor %}
{% assign order = d.order %}
{% if d.order == nil %}
{% assign order = 9999 %}
{% endif %}
], url: "{{d.url}}", title: "{{d.title}}", order: {{order}}, overview: "{{d.overview}}"});
{% endif %}
{% endfor %}
genNavBarTree(docs)
</script>
{% endif %}
</ul>