-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathsidebar-toc.html
59 lines (53 loc) · 2.19 KB
/
sidebar-toc.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
{% if page.includeTOC or layout.includeTOC %}
{% if page.includeTOC != false %}
<!-- Don't include TOC -->
{% for pg in site.posts %}
{% if pg.overview == page.overview and pg.languages %}
{% assign languages = pg.languages %}
{% endif %}
{% endfor %}
{% for pg in site.pages %}
{% if pg.overview == page.overview and pg.languages %}
{% assign languages = pg.languages %}
{% endif %}
{% endfor %}
{% if page.language %}
{% capture intermediate %}{{ page.url | remove_first: page.language }}{% endcapture %}
{% capture rootTutorialURL %}{{ intermediate | remove_first: '/' }}{% endcapture %}
{% else %}
{% assign rootTutorialURL = page.url %}
{% endif %}
<div class="content-nav">
<div class="inner-box sidebar-toc-wrapper" style="">
<!-- <li><a href="{{ site.baseurl }}{{ rootTutorialURL }}" class="lang">English</a></li>
{% for l in languages %}
{% assign lang = site.data.languages[l] %}
<li><a href="{{ site.baseurl }}/{{ l }}{{ rootTutorialURL }}" class="lang">{{lang.name}}</a></li>
{% endfor %} -->
<h5 class="contents">Contents</h5>
<div class="inner-toc" id="sidebar-toc">
{% if page.includeCollectionTOC or layout.includeCollectionTOC %}
{% for collection in site.collections %}
{% assign name = collection.label %}
{% if page.partof == name %}
{% assign sorted = (site.[name]| sort: 'num') %}
<ul>
{% for pg in sorted %}
{% if pg.num %}
<li><a href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
{% if pg.num == page.num %}
<div id="toc"></div>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
{% endif %}
</div>
<hr>
<div class="help-us"><a href="https://github.com/scala/docs.scala-lang/blob/main/{% if page.collection %}{{ page.relative_path }}{% else %}{{ page.path }}{% endif %}"><i class="fa fa-pencil" aria-hidden="true"></i> Problem with this page?<br> Please help us fix it!</a></div>
</div>
</div>
{% endif %}
{% endif %}