Skip to content

Commit

Permalink
simplify menu
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasbuschmann authored Feb 27, 2021
1 parent c24c4c7 commit 61b3aa9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
<link rel="stylesheet" href="{{ "/assets/css/sidebar.css" | relative_url }}" media="screen and (min-width: 70em)">
<aside style="display: none">
{% include menu.html menu=site.navigation text=true icon=true %}
{% include menu.html menu=site.external text=true icon=true %}
<nav>
{%- for item in site.navigation -%}
{%- assign node = site.pages | where: "name", item.file | first -%}
{%- assign url = item.url | default: node.url -%}
{%- assign title = item.title | default: node.title -%}
{%- assign icon = item.icon | default: item.sidebaricon -%}
<a aria-label="{{ title }}" href="{{ url | relative_url }}" {% if url == page.url %}class="selected"{% endif %}>
<svg aria-hidden="true" class="icon"><use xlink:href="{{ "/assets/fontawesome/icons.svg" | relative_url }}#{{ icon }}"></use></svg>
<span aria-hidden="true">{{ title }}</span>
</a>
{%- endfor -%}
{%- for item in site.external -%}
{%- assign node = site.pages | where: "name", item.file | first -%}
{%- assign url = item.url | default: node.url -%}
{%- assign title = item.title | default: node.title -%}
{%- assign icon = item.icon | default: item.sidebaricon -%}
<a aria-label="{{ title }}" href="{{ url | relative_url }}" {% if url == page.url %}class="selected"{% endif %}>
<svg aria-hidden="true" class="icon"><use xlink:href="{{ "/assets/fontawesome/icons.svg" | relative_url }}#{{ icon }}"></use></svg>
<span aria-hidden="true">{{ title }}</span>
</a>
{%- endfor -%}
</nav>
<div class="description">{{ site.description }}</div>
</aside>

0 comments on commit 61b3aa9

Please sign in to comment.