Skip to content

Commit 493250d

Browse files
author
Bas van Schaik
committed
change Lanyon behaviour slightly
menu is visible by default version information is hidden (unless provided) (see poole/lanyon#275)
1 parent c9847dd commit 493250d

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

_includes/sidebar.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular
2+
styles, `#sidebar-checkbox` for behavior. -->
3+
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox" checked>
4+
5+
<!-- Toggleable sidebar -->
6+
<div class="sidebar" id="sidebar">
7+
<div class="sidebar-item">
8+
<p>{{ site.description }}</p>
9+
</div>
10+
11+
<nav class="sidebar-nav">
12+
<a class="sidebar-nav-item{% if page.title == 'Home' %} active{% endif %}" href="{{ '/' | absolute_url }}">Home</a>
13+
14+
{% comment %}
15+
The code below dynamically generates a sidebar nav of pages with
16+
`layout: page` in the front-matter. See readme for usage.
17+
{% endcomment %}
18+
19+
{% assign pages_list = site.pages | sort:"url" %}
20+
{% for node in pages_list %}
21+
{% if node.title != null %}
22+
{% if node.layout == "page" %}
23+
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url | absolute_url }}">{{ node.title }}</a>
24+
{% endif %}
25+
{% endif %}
26+
{% endfor %}
27+
28+
{% if site.github.repo != null %}
29+
<a class="sidebar-nav-item" href="{{ site.github.repo }}/archive/v{{ site.version }}.zip">Download</a>
30+
<a class="sidebar-nav-item" href="{{ site.github.repo }}">GitHub project</a>
31+
{% endif %}
32+
33+
{% if site.version != null %}
34+
<span class="sidebar-nav-item">Currently XXX v{{ site.version }}</span>
35+
{% endif %}
36+
</nav>
37+
38+
<div class="sidebar-item">
39+
<p>
40+
&copy; {{ site.time | date: '%Y' }}. All rights reserved.
41+
</p>
42+
</div>
43+
</div>

0 commit comments

Comments
 (0)