Skip to content

Commit d3d2252

Browse files
committed
turned the api sidebar into a partial
1 parent 3a245c3 commit d3d2252

File tree

3 files changed

+44
-59
lines changed

3 files changed

+44
-59
lines changed

_includes/apiSidebar.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<nav id="api" class="sidebar sticky">
2+
<a href="{{ site.github.url }}/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
3+
Introduction
4+
</a>
5+
<a href="{{ site.github.url }}/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
6+
Expect / Should
7+
</a>
8+
<a href="{{ site.github.url }}/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
9+
Assert
10+
</a>
11+
<a href="{{ site.github.url }}/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
12+
Plugin Utilities
13+
</a>
14+
<a href="{{ site.github.url }}/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
15+
Online Test Suite
16+
</a>
17+
{% if page.api_namespace %}
18+
<div class="list box-wrap antiscroll-wrap" style="height: 338px;">
19+
<div class="box">
20+
<div class="antiscroll-inner" style="height: 338px; width: 225px;">
21+
<div class="box-inner">
22+
{% for method in site.data.chai %}
23+
{% assign render = false %}
24+
{% assign name = false %}
25+
{% for tag in method.tags %}
26+
{% if tag.type == "namespace" and tag.string == page.api_namespace %}
27+
{% assign render = true %}
28+
{% endif %}
29+
{% if tag.type == "name" %}
30+
{% capture name %}{{ tag.string }}{% endcapture %}
31+
{% endif %}
32+
{% endfor %}
33+
{% if render %}
34+
<a href="#method_{{ name | slugify }}" class="scroll item">{{ name }}</a>
35+
{% endif %}
36+
{% endfor %}
37+
</div>
38+
</div>
39+
</div>
40+
</div>
41+
{% endif %}
42+
</nav>

_layouts/api.html

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,7 @@
22
layout: default
33
bodyClass: api
44
---
5-
<nav id="api" class="sidebar sticky">
6-
<a href="{{ site.github.url }}/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
7-
Introduction
8-
</a>
9-
<a href="{{ site.github.url }}/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
10-
Expect / Should
11-
</a>
12-
<a href="{{ site.github.url }}/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
13-
Assert
14-
</a>
15-
<a href="{{ site.github.url }}/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
16-
Plugin Utilities
17-
</a>
18-
<a href="{{ site.github.url }}/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
19-
Online Test Suite
20-
</a>
21-
{% if page.api_namespace %}
22-
<div class="list box-wrap antiscroll-wrap" style="height: 338px;">
23-
<div class="box">
24-
<div class="antiscroll-inner" style="height: 338px; width: 225px;">
25-
<div class="box-inner">
26-
{% for method in site.data.chai %}
27-
{% assign render = false %}
28-
{% assign name = false %}
29-
{% for tag in method.tags %}
30-
{% if tag.type == "namespace" and tag.string == page.api_namespace %}
31-
{% assign render = true %}
32-
{% endif %}
33-
{% if tag.type == "name" %}
34-
{% capture name %}{{ tag.string }}{% endcapture %}
35-
{% endif %}
36-
{% endfor %}
37-
{% if render %}
38-
<a href="#method_{{ name | slugify }}" class="scroll item">{{ name }}</a>
39-
{% endif %}
40-
{% endfor %}
41-
</div>
42-
</div>
43-
</div>
44-
</div>
45-
{% endif %}
46-
</nav>
5+
{% include apiSidebar.html %}
476
<div class="documentation">
487
<div class="wrap">
498
<div class="rendered">

_layouts/test.html

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,7 @@
22
layout: default
33
bodyClass: tests
44
---
5-
<nav id="api" class="sidebar sticky">
6-
<a href="{{ site.github.url }}/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
7-
Introduction
8-
</a>
9-
<a href="{{ site.github.url }}/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
10-
Expect / Should
11-
</a>
12-
<a href="{{ site.github.url }}/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
13-
Assert
14-
</a>
15-
<a href="{{ site.github.url }}/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
16-
Plugin Utilities
17-
</a>
18-
<a href="{{ site.github.url }}/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
19-
Online Test Suite
20-
</a>
21-
</nav>
5+
{% include apiSidebar.html %}
226
<div class="documentation">
237
<div class="wrap">
248
<div class="rendered">

0 commit comments

Comments
 (0)