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>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ site.baseurl | append: '/' }}">{{ site.nav.home | default: "Home" }}</a>
|
{% if site.home.hide_home %}
|
||||||
{% if jekyll.environment == 'local' %}
|
<!-- home menu hidden per _config.yaml nav.hide_home_link -->
|
||||||
<li><a href="{{ site.baseurl | append: '/private/' }}">Private</a>
|
{% else %}
|
||||||
|
<li><a href="{{ '/' | relative_url }}">{{ site.nav.home | default: "Home" }}</a>
|
||||||
{% endif %}
|
{% 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' %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% include additional_glboal_nav.html %}
|
{% include additional_glboal_nav.html %}
|
||||||
|
|
||||||
|
{% if jekyll.environment == 'local' %}
|
||||||
|
<li><a href="{{ '/private/' | relative_url }}">Private</a>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
Loading…
Reference in New Issue
Block a user