Skip to content

Commit a9990fb

Browse files
committed
revamp sidebar linking, enable active flag
1 parent 470083c commit a9990fb

5 files changed

Lines changed: 48 additions & 50 deletions

File tree

_config.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,18 @@ branch: master
2727
# List links that should appear in the site sidebar here
2828
navigation:
2929
- text: HTTPS for .gov
30-
url: ""
31-
internal: true
30+
url: /
3231
- text: Why Everything?
33-
url: everything/
34-
internal: true
32+
url: /everything/
3533
- text: FAQ
36-
url: faq/
37-
internal: true
34+
url: /faq/
3835
- text: Server Name Indication
39-
url: sni/
40-
internal: true
36+
url: /sni/
4137
- text: Strict Transport Security
42-
url: hsts/
43-
internal: true
38+
url: /hsts/
4439
- text: Mixed Content
45-
url: mixed-content/
46-
internal: true
40+
url: /mixed-content/
4741
- text: Other Technical Concepts
48-
url: technical-concepts/
49-
internal: true
42+
url: /technical-concepts/
5043
- text: Resources
51-
url: resources/
52-
internal: true
44+
url: /resources/

_includes/sidebar.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
<nav class="sidebar-nav" role="navigation">
44
<ul>
55
{% for link in site.navigation %}
6-
{% if link.internal == true %}
7-
<li><a href="{{ site.baseurl }}/{{ link.url }}">{{ link.text }}</a></li>
8-
{% else %}
9-
<li><a href="{{ link.url }}">{{ link.text }}</a></li>
6+
{% assign current = '' %}
7+
{% if page.url == link.url %}
8+
{% assign current = 'sidebar-nav-active' %}
109
{% endif %}
10+
<li class="{{ current }}">
11+
<a href="{{ link.url }}">{{ link.text }}</a>
12+
</li>
1113
{% endfor %}
1214
</ul>
1315
</nav>

assets/_sass/styles.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ li p {
9191

9292
aside {
9393

94+
padding-top: 15px;
95+
9496
p {
9597
padding-left: 15px;
9698
}

assets/css/styles.css

Lines changed: 31 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/styles.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)