refactor how global menu is compiled; also add an option to hide home item
This commit is contained in:
parent
ca203b3325
commit
8990aa978c
@ -1,16 +1,25 @@
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="{{ site.baseurl | append: '/' }}">{{ site.nav.home | default: "Home" }}</a>
|
||||
{% if jekyll.environment == 'local' %}
|
||||
<li><a href="{{ site.baseurl | append: '/private/' }}">Private</a>
|
||||
{% if site.home.hide_home %}
|
||||
<!-- home menu hidden per _config.yaml nav.hide_home_link -->
|
||||
{% else %}
|
||||
<li><a href="{{ '/' | relative_url }}">{{ site.nav.home | default: "Home" }}</a>
|
||||
{% endif %}
|
||||
{% for page in site.pages | sort: 'sort_order', 'title' %}
|
||||
|
||||
{% assign sorted_pages=(site.pages | sort: "sort_order") %}
|
||||
|
||||
{% for page in sorted_pages %}
|
||||
{% if page.categories contains 'global' %}
|
||||
<li><a href="{{ site.baseurl | append: page.url }}">{{ page.title }}</a>
|
||||
<li><a href="{{ page.url | relative_url }}">{{ page.title }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include additional_glboal_nav.html %}
|
||||
|
||||
{% if jekyll.environment == 'local' %}
|
||||
<li><a href="{{ '/private/' | relative_url }}">Private</a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
Loading…
Reference in New Issue
Block a user