Enable macros for nav item listing
This commit is contained in:
parent
7cfcf011ce
commit
5e5706b55d
@ -12,3 +12,9 @@ external_links_no_follow = true
|
||||
external_links_no_referrer = true
|
||||
|
||||
[extra]
|
||||
nav = [
|
||||
{title = "Informace", path = "/informace/"},
|
||||
{title = "Personál", path = "/personal/"},
|
||||
{title = "Kontakt", path = "/kontakt/"},
|
||||
{title = "Přihlášky", path = "https://prihlasky.kocandaci.cz", external = true}
|
||||
]
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% import "macros.html" as macros %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
@ -12,9 +13,7 @@
|
||||
<div class="wrap">
|
||||
<a href="{{ config.base_url }}"><img src="img/logo.svg" class="logo"></a>
|
||||
<ul>
|
||||
<li><a href="#">Home</a></li>
|
||||
<li><a href="#">About</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
{{ macros::nav_items() }}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
9
templates/macros.html
Normal file
9
templates/macros.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% macro nav_items() %}
|
||||
{% for item in config.extra.nav %}
|
||||
{% if item.external %}
|
||||
<li><a class="external" href="{{ item.path }}">{{ item.title }}</a></li>
|
||||
{% else %}
|
||||
<li><a href="{{ item.path }}">{{ item.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
Loading…
Reference in New Issue
Block a user