Creates navigation

This commit is contained in:
David Darnes 2016-06-16 00:24:33 +01:00
parent 2c3cc33b1e
commit fdb2035db0
2 changed files with 17 additions and 1 deletions

View File

@ -2,10 +2,12 @@
<a href="{{ page.url }}" title="{{ page.title }}">
<img class="avatar" src="{{ site.logo | replace: "300", "72" }}" alt="{{ site.title }}" srcset="{{ site.logo | replace: "300", "72" }} 72w, {{ site.logo | replace: "300", "144" }} 144w">
<img class="avatar" src="{{ site.logo | replace: "300", "72" }}" alt="{{ site.title }}" srcset="{{ site.logo | replace: "300", "72" }} 72w, {{ site.logo | replace: "300", "144" }} 144w" width="72" height="72">
</a>
{% include nav.html %}
<div class="container">
<h1>{{ page.title }}</h1>

14
_includes/nav.html Normal file
View File

@ -0,0 +1,14 @@
<nav class="nav">
<button class="button button--nav">Menu</button>
{% if data.nav %}
{% for item in data.nav %}
<a href="{{ item.url }}" title="{{ item.name }}">{{ item.name }}</a>
{% endfor %}
{% else %}
{% for page in site.pages %}
{% if page.title %}
<a href="{{ page.url }}" title="{{ page.title }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
{% endif %}
</nav>