Open external LINKS in new window, relative LINKS in same window

This is an improvement over commit 90e3ee38f so it's not necessary to
change the structure of the LINKS setting, just set relative links and
they will be open in the same window, same as the `MAIN_MENU`.
This commit is contained in:
Fidel Ramos 2019-10-19 20:33:30 +00:00
parent 90e3ee38ff
commit d3d7a8fc7f
No known key found for this signature in database
GPG key ID: 64490E0A752C21C4

View file

@ -116,14 +116,9 @@
{% endfor %}
{% endif %}
{% for link_tuple in LINKS %}
{% if link_tuple|length == 2 %}
{% set name, link = link_tuple %}
<li><a href="{{ link }}" target="_blank">{{ name }}</a></li>
{% else %}
{% set name, link, new_window = link_tuple %}
<li><a href="{{ link }}" {% if new_window %}target="_blank"{% endif %}>{{ name }}</a></li>
{% endif %}
{% for name, link in LINKS %}
{# Open external links in new window, relative links in the same window #}
<li><a href="{{ link }}" {% if link[:4] == 'http' %}target="_blank"{% endif %}>{{ name }}</a></li>
{% endfor %}
</ul>
</nav>