Enable blank target in nav links

This commit is contained in:
Emil Miler 2024-01-12 10:14:19 +01:00
parent 6ac0d1899f
commit 106e4b0d6e
2 changed files with 7 additions and 4 deletions

View File

@ -17,5 +17,5 @@ nav = [
{title = "Personál", path = "/personal/"}, {title = "Personál", path = "/personal/"},
{title = "Galerie", path = "/galerie/"}, {title = "Galerie", path = "/galerie/"},
{title = "Kontakt", path = "/kontakt/"}, {title = "Kontakt", path = "/kontakt/"},
{title = "Přihlášky", path = "https://is.kocandaci.cz", external = true} {title = "Přihlášky", path = "https://is.kocandaci.cz", external = true, target_blank = true}
] ]

View File

@ -1,10 +1,13 @@
{% macro nav_items() %} {% macro nav_items() %}
{% for item in config.extra.nav %} {% for item in config.extra.nav %}
<li><a
{% if item.external %} {% if item.external %}
<li><a class="external" href="{{ item.path }}">{{ item.title }}</a></li> class="external" href="{{ item.path }}"
{% else %}
<li><a href="{{ item.path }}">{{ item.title }}</a></li>
{% endif %} {% endif %}
{% if item.target_blank %}
target="_blank"
{% endif %}
href="{{ item.path }}">{{ item.title }}</a></li>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}