[gtk-web/issue-10: 2/2] Open external navbar links in a separate tab/window



commit 74a32e6500c6194f53fc277ec890284d17494d80
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jan 24 15:02:21 2020 +0000

    Open external navbar links in a separate tab/window
    
    Fixes: #10

 _includes/navbar.html | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/_includes/navbar.html b/_includes/navbar.html
index ed48e6c..2f85489 100644
--- a/_includes/navbar.html
+++ b/_includes/navbar.html
@@ -39,10 +39,12 @@ to make changes related to the content, edit the `_data/navigation.yml`.
               {% if link.header %}
                 {% if link.external %}
                   {% assign link_href = link.href %}
+                  {% assign target_blank = 'target="_blank"' %}
                 {% else %}
                   {% assign link_href = link.href | prepend: site.url %}
+                  {% assign target_blank = '' %}
                 {% endif %}
-                <a href="{{ link_href }}" class="nav-link-{{ bg_color }} float-right text-{{ text_color }} 
rounded">{{ link.name }}</a>
+                <a href="{{ link_href }}" {{ target_blank }} class="nav-link-{{ bg_color }} float-right 
text-{{ text_color }} rounded">{{ link.name }}</a>
               {% endif %}
             {% endfor %}
         </ul>
@@ -68,4 +70,4 @@ to make changes related to the content, edit the `_data/navigation.yml`.
       e.preventDefault();
       $("html, body").animate({scrollTop: 0});
     });
-  </script>
\ No newline at end of file
+  </script>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]