forked from apache/calcite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs_ul.html
34 lines (30 loc) · 1.53 KB
/
docs_ul.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{% assign items = include.items %}
<ul>
{% for item in items %}
{% comment %} Account for the baseurl to make sure we compare the full URI. {% endcomment %}
{% capture item_url %}{{site.baseurl}}{{ item | prepend:"/docs/" | append:".html" }}{% endcapture %}
{% capture item_url2 %}{{site.baseurl}}{{ item | prepend:"/docs/" | append:"/" }}{% endcapture %}
{% capture current_url %}{{ site.baseurl }}{{ page.url }}{% endcapture %}
{% if item_url == current_url %}
{% assign c = "current" %}
{% else %}
{% assign c = "" %}
{% endif %}
{% for p in site.docs %}{% comment %}
{% endcomment %}{% capture p_url %}{{site.baseurl}}{{p.url}}{% endcapture %}{% comment %}
{% endcomment %}{% if p.sidebar_title != nil %}{% comment %}
{% endcomment %}{% assign anchor_text = p.sidebar_title %}{% comment %}
{% endcomment %}{% else %}{% comment %}
{% endcomment %}{% assign anchor_text = p.title %}{% comment %}
{% endcomment %}{% endif %}{% comment %}
{% endcomment %}{% if p_url == item_url %}{% comment %}
{% endcomment %}<li class="{{ c }}"><a href="{{ p_url }}">{{ anchor_text }}</a></li>{% comment %}
{% endcomment %}{% break %}{% comment %}
{% endcomment %}{% endif %}{% comment %}
{% endcomment %}{% if p_url == item_url2 %}{% comment %}
{% endcomment %}<li class="{{ c }}"><a href="{{ p.external_url }}">{{ anchor_text }}</a></li>{% comment %}
{% endcomment %}{% break %}{% comment %}
{% endcomment %}{% endif %}{% comment %}
{% endcomment %}{% endfor %}
{% endfor %}
</ul>