Skip to content

Commit

Permalink
fix: list home page only one time as "Home", see mmistakes/jekyll-the…
Browse files Browse the repository at this point in the history
  • Loading branch information
spygi committed May 17, 2018
1 parent afeee39 commit 60bed52
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions _includes/navigation.html
@@ -0,0 +1,25 @@
<nav id="primary-nav" class="site-nav" itemscope itemtype="http://schema.org/SiteNavigationElement" aria-label="Main navigation">
<ul id="menu-main-navigation" class="menu">
<!-- Home link -->
<li class="menu-item">
<a href="{{ '/' | relative_url }}" itemprop="url">
<span itemprop="name">{{ site.data.theme.t.home | default: 'Home' }}</span>
</a>
</li>

<!-- site.pages links -->
{% assign default_paths = site.pages | map: "path" %}
{% assign page_paths = site.data.theme.navigation_pages | default: default_paths %}

{% for path in page_paths %}
{% assign my_page = site.pages | where: "path", path | first %}
{% if my_page.title and my_page.layout != "home" %}
<li class="menu-item">
<a href="{{ my_page.url | relative_url }}" itemprop="url">
<span itemprop="name">{{ my_page.title | escape }}</span>
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>

0 comments on commit 60bed52

Please sign in to comment.