refactor: Extract a navbar include
This commit is contained in:
parent
26ceec5f20
commit
6246c137b4
7
source/_includes/navbar.html.twig
Normal file
7
source/_includes/navbar.html.twig
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<nav>
|
||||||
|
{% for link in links %}
|
||||||
|
<a href="{{ link.href }}">
|
||||||
|
{{ link.title }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</nav>
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue