Skip to content

Commit

Permalink
[refs #3] Fix about navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Heibült committed Feb 23, 2018
1 parent 2cdcee2 commit 941558f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
1 change: 1 addition & 0 deletions about/index.md → _about/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: page
title: About
category: "about"
---
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit

Expand Down
1 change: 1 addition & 0 deletions about/team.md → _about/team.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: page
title: Team
category: "about"
---

<ul class="o-layout">
Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ permalink: pretty

# Collections
collections:
about:
output: true
permalink: /:collection/:path/
docs:
output: true
permalink: /:collection/:path/
Expand Down
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<nav class="c-nav-primary c-page-head__nav">

<a href="/" class="c-nav-primary__link c-page__home">Home</a>
<a href="/about/" class="c-nav-primary__link c-page__about">About</a>
<a href="/about/index/" class="c-nav-primary__link c-page__about">About</a>
<a href="/docs/" class="c-nav-primary__link c-page__docs">Docs</a>
<a href="/blog/" class="c-nav-primary__link c-page__blog">Blog</a>
<a href="{{ site.github }}" class="c-nav-primary__link">GitHub</a>
Expand Down
45 changes: 29 additions & 16 deletions _includes/secondary-nav.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
<ul class="c-nav-secondary">

{% assign categories = site.docs | where: "order", 1 %}
{% for category in categories %}
<li class="c-nav-secondary__item">
{% assign docs = site.docs | where: "group", category.group | sort: "order" %}
{% for doc in docs %}
{% if doc.order == 1 %}
<a href="{{ doc.url | prepend: site.baseurl }}" class="c-nav-secondary__link">{{ doc.group }}</a>
{% endif %}
<ul class="c-nav-secondary c-nav-secondary--sub">
<li class="c-nav-secondary__item">
<a class="c-nav-secondary__link" href="{{ doc.url | prepend: site.baseurl }}">{{ doc.title }}</a>
</li>
</ul>
{% endfor %}
</li>
{% endfor %}
{% if page.category == "about" %}

{% assign pages = site.about %}
{% for page in pages %}
<li class="c-nav-secondary__item">
<a href="{{ page.url | prepend: site.baseurl }}" class="c-nav-secondary__link">{{ page.title }}</a>
</li>
{% endfor %}

{% else %}

{% assign categories = site.docs | where: "order", 1 %}
{% for category in categories %}
<li class="c-nav-secondary__item">
{% assign docs = site.docs | where: "group", category.group | sort: "order" %}
{% for doc in docs %}
{% if doc.order == 1 %}
<a href="{{ doc.url | prepend: site.baseurl }}" class="c-nav-secondary__link">{{ doc.group }}</a>
{% endif %}
<ul class="c-nav-secondary c-nav-secondary--sub">
<li class="c-nav-secondary__item">
<a class="c-nav-secondary__link" href="{{ doc.url | prepend: site.baseurl }}">{{ doc.title }}</a>
</li>
</ul>
{% endfor %}
</li>
{% endfor %}

{% endif %}

</ul>

0 comments on commit 941558f

Please sign in to comment.