forked from EventStore/eventstore.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs-sidebar.html
60 lines (54 loc) · 2.53 KB
/
docs-sidebar.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<ul class="docs-sidebar__list">
<li><a href="/">Documentation Home</a></li>
{% for section in site.top_level_sections %}
{% if page.section == section %}
{% assign sectionClass = "expanded" %}
{% else %}
{% assign sectionClass = "collapsed" %}
{% endif %}
{% if section == "Introduction" %}
{% assign sectionClass = "expanded" %}
{% endif %}
<li>
<span onclick="$(this).toggleClass('expanded collapsed');" class="docs-sidebar__heading {{ sectionClass }}">{{ section }}</span>
<ul>
{% if page.section == ".NET API" %}
{% assign viewing_server_version = site.latest_versions.server %}
{% assign viewing_dotnet_version = page.version %}
{% else %}
{% if page.version %}
{% assign viewing_server_version = page.version %}
{% else %}
{% assign viewing_server_version = site.latest_versions.server %}
{% endif %}
{% assign viewing_dotnet_version = site.latest_versions.dotnet-api %}
{% endif %}
{% assign pages = site.pages | where:"section",section | where:"exclude_from_sidebar", false %}
{% assign pinnedItems = pages| where:"pinned", true | sort: "title" %}
{% assign normalItems = pages | where:"pinned", false | sort: "title" %}
{% for item in pinnedItems %}
{% if item.section == ".NET API" and item.version == viewing_dotnet_version %}
<li>
<a href="{{ item.url }}">{{ item.title }}</a>
</li>
{% elsif item.section != ".NET API" and item.version == viewing_server_version %}
<li>
<a href="{{ item.url }}">{{ item.title }}</a>
</li>
{% endif %}
{% endfor %}
{% for item in normalItems %}
{% if item.section == ".NET API" and item.version == viewing_dotnet_version %}
<li>
<a href="{{ item.url }}">{{ item.title }}</a>
</li>
{% elsif item.section != ".NET API" and item.version == viewing_server_version %}
<li>
<a href="{{ item.url }}">{{ item.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>