From 90e3ee38ff6e9db3ba6d053f9285f9a0c8990945 Mon Sep 17 00:00:00 2001 From: Fidel Ramos Date: Sat, 19 Oct 2019 16:54:40 +0000 Subject: [PATCH] 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. --- templates/base.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/base.html b/templates/base.html index 2425148..a5dc1fa 100644 --- a/templates/base.html +++ b/templates/base.html @@ -116,8 +116,14 @@ {% endfor %} {% endif %} - {% for name, link in LINKS %} -
  • {{ name }}
  • + {% for link_tuple in LINKS %} + {% if link_tuple|length == 2 %} + {% set name, link = link_tuple %} +
  • {{ name }}
  • + {% else %} + {% set name, link, new_window = link_tuple %} +
  • {{ name }}
  • + {% endif %} {% endfor %}