Support defining LINKS that open in the same window
Currently all LINKS open in a new window (target="_blank"), but in some cases it's desirable to open them in the same window. For example I use it for linking to categories and tags: LINKS = ( ('Categories', SITEURL+'/categories#categories', False), ('Tags', SITEURL+'/tags#tags', False), ) Old format and experience is still supported, this is backwards-compatible.
This commit is contained in:
parent
4180f7e9c1
commit
90e3ee38ff
1 changed files with 8 additions and 2 deletions
|
@ -116,8 +116,14 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for name, link in LINKS %}
|
{% for link_tuple in LINKS %}
|
||||||
<li><a href="{{ link }}" target="_blank">{{ name }}</a></li>
|
{% 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 %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue