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' %}
|
||||
|
||||
{% block body %}
|
||||
<nav>
|
||||
{% for link in site.main_menu %}
|
||||
<a href="{{ link.href }}">{{ link.title }}</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
{% include 'navbar' with {
|
||||
links: site.main_menu,
|
||||
} only %}
|
||||
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue