Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit d02ce6f

Browse files
authored
Merge pull request #100 from cglotr/fix-navigation
Fix left navigation not showing
2 parents 8dcc485 + 910626f commit d02ce6f

File tree

2 files changed

+46
-18
lines changed

2 files changed

+46
-18
lines changed

_data/nav.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
docs:
2+
3+
- title: Go database/sql tutorial
4+
url: index.html
5+
6+
- title: Overview
7+
url: overview.html
8+
9+
- title: Importing a Database Driver
10+
url: importing.html
11+
12+
- title: Accessing the Database
13+
url: accessing.html
14+
15+
- title: Retrieving Result Sets
16+
url: retrieving.html
17+
18+
- title: Modifying Data and Using Transactions
19+
url: modifying.html
20+
21+
- title: Using Prepared Statements
22+
url: prepared.html
23+
24+
- title: Handling Errors
25+
url: errors.html
26+
27+
- title: Working with NULLs
28+
url: nulls.html
29+
30+
- title: Working with Unknown Columns
31+
url: varcols.html
32+
33+
- title: The Connection Pool
34+
url: connection-pool.html
35+
36+
- title: Surprises, Antipatterns and Limitations
37+
url: surprises.html
38+
39+
- title: Related Reading and Resources
40+
url: references.html

_includes/leftnav.html

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
<div class="leftnav">
22
<ul class="nav nav-list">
3-
{% for group in page.nav %}
4-
{% capture group_url %}/{{ page.name }}/{{ group.url }}{% endcapture %}
5-
<li class="nav-header{% if page.url == node_url %} active{% endif %}">
6-
{% if page.url %}
7-
<a href="{{group.url}}">{{group.name}}</a>
8-
{% else %}
9-
{{group.name}}
10-
{% endif %}
11-
</li>
12-
{% for node in group.articles %}
13-
{% capture node_url %}/{{ page.name }}/{{ node.url }}{% endcapture %}
14-
{% if page.url == node_url %}
15-
<li class="active"><a href="{{node.url}}">{{node.title}}</a></li>
16-
{% else %}
17-
<li><a href="{{node.url}}">{{node.title}}</a></li>
18-
{% endif %}
19-
{% endfor %}
20-
{% endfor %}
3+
{% for doc in site.data.nav.docs %}
4+
{% assign curr_url = page.url | remove_first: "/" %}
5+
<li class="{% if doc.url == 'index.html' %}nav-header{% endif %} {% if curr_url == doc.url %}active{% endif %}">
6+
<a href="{{ doc.url }}">{{ doc.title }}</a>
7+
</li>
8+
{% endfor %}
219
</ul>
2210
<hr />
2311
<div class="license">

0 commit comments

Comments
 (0)