refactor: Extract a navbar include

This commit is contained in:
Oliver Davies 2021-09-07 21:07:06 +01:00
parent 26ceec5f20
commit 6246c137b4
2 changed files with 10 additions and 5 deletions

View file

@ -0,0 +1,7 @@
<nav>
{% for link in links %}
<a href="{{ link.href }}">
{{ link.title }}
</a>
{% endfor %}
</nav>

View file

@ -1,11 +1,9 @@
{% extends 'app' %} {% extends 'app' %}
{% block body %} {% block body %}
<nav> {% include 'navbar' with {
{% for link in site.main_menu %} links: site.main_menu,
<a href="{{ link.href }}">{{ link.title }}</a> } only %}
{% endfor %}
</nav>
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>