Skip to content

Commit

Permalink
Hide nav toggle if nav is empty. (jekyll#289)
Browse files Browse the repository at this point in the history
Nav toggle button would display in mobile view even if nav dropdown is empty.
  • Loading branch information
samueldiethelm authored and DirtyF committed Oct 29, 2018
1 parent 4e6c5e7 commit e462092
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<div class="wrapper">
{%- assign default_paths = site.pages | map: "path" -%}
{%- assign page_paths = site.header_pages | default: default_paths -%}
{%- assign titles_size = site.pages | map: 'title' | join: '' | size -%}
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>

{%- if page_paths -%}
{%- if titles_size > 0 -%}
<nav class="site-nav">
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger">
Expand Down

0 comments on commit e462092

Please sign in to comment.