Skip to content

Commit

Permalink
change Lanyon behaviour slightly
Browse files Browse the repository at this point in the history
menu is visible by default
version information is hidden (unless provided)
(see poole/lanyon#275)
  • Loading branch information
Bas van Schaik committed May 23, 2021
1 parent c9847dd commit 493250d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular
styles, `#sidebar-checkbox` for behavior. -->
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox" checked>

<!-- Toggleable sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-item">
<p>{{ site.description }}</p>
</div>

<nav class="sidebar-nav">
<a class="sidebar-nav-item{% if page.title == 'Home' %} active{% endif %}" href="{{ '/' | absolute_url }}">Home</a>

{% comment %}
The code below dynamically generates a sidebar nav of pages with
`layout: page` in the front-matter. See readme for usage.
{% endcomment %}

{% assign pages_list = site.pages | sort:"url" %}
{% for node in pages_list %}
{% if node.title != null %}
{% if node.layout == "page" %}
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url | absolute_url }}">{{ node.title }}</a>
{% endif %}
{% endif %}
{% endfor %}

{% if site.github.repo != null %}
<a class="sidebar-nav-item" href="{{ site.github.repo }}/archive/v{{ site.version }}.zip">Download</a>
<a class="sidebar-nav-item" href="{{ site.github.repo }}">GitHub project</a>
{% endif %}

{% if site.version != null %}
<span class="sidebar-nav-item">Currently XXX v{{ site.version }}</span>
{% endif %}
</nav>

<div class="sidebar-item">
<p>
&copy; {{ site.time | date: '%Y' }}. All rights reserved.
</p>
</div>
</div>

0 comments on commit 493250d

Please sign in to comment.