commit df92b63a28094ecb6d5b7d4de16e87f7d282b25b
Author: hiro <h...@torproject.org>
Date:   Thu Jan 3 13:49:19 2019 +0100

    Fix paths and relative urls in navbar
---
 templates/navbar.html | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/templates/navbar.html b/templates/navbar.html
index b37510a..bd83520 100644
--- a/templates/navbar.html
+++ b/templates/navbar.html
@@ -12,11 +12,17 @@
   <div class="collapse navbar-collapse hamburger-menu" 
id="navbarSupportedContent">
     <div class="mx-auto pt-2 pl-4">
       <ul class="navbar-nav">
-       {% set menubag = 'menu+' + this.alt %}
+             {% set menubag = 'menu+' + this.alt %}
        {% for id, item in bag(menubag).items() %}
-       <li{% if this.is_child_of(item.path) %} class="nav-item active" {% else 
%} class="nav-item"{% endif %}>
-          <a class="nav-link" href="{{ item.path|url }}">{{ item.label }}
-            {% if this.is_child_of(item.path) %}
+       <li{% if this.is_child_of(item.path) %} class="nav-item active" {% else 
%} class="nav-item"{% endif %}>
+          {% set link = site.get(item.path) %}
+          {% if link %}
+            <a class="nav-link" href="{{ item.path|url }}">
+          {% else %}
+            <a class="nav-link" href="{{ item.path }}">
+          {% endif %}
+          {{ item.label }}
+            {% if this.path == item.path %}
             <span class="sr-only">(current)</span>
             {% endif %}
           </a>

_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to