Add target attribute for navigation link (#3056)

This commit is contained in:
Dmitriy Derepko
2024-05-05 17:12:37 +08:00
committed by GitHub
parent f1ffad4b5e
commit ceeda03132
3 changed files with 9 additions and 1 deletions
+3
View File
@@ -2,6 +2,9 @@
*~ *~
*.sw[p_] *.sw[p_]
# IntelliJ IDEA
*.idea
# Sublime Text # Sublime Text
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
+5 -1
View File
@@ -14,7 +14,11 @@
<ul class="visible-links"> <ul class="visible-links">
{%- for link in site.data.navigation.main -%} {%- for link in site.data.navigation.main -%}
<li class="masthead__menu-item"> <li class="masthead__menu-item">
<a href="{{ link.url | relative_url }}"{% if link.description %} title="{{ link.description }}"{% endif %}>{{ link.title }}</a> <a
href="{{ link.url | relative_url }}"
{% if link.description %} title="{{ link.description }}"{% endif %}
{% if link.target %} target="{{ link.target }}"{% endif %}
>{{ link.title }}</a>
</li> </li>
{%- endfor -%} {%- endfor -%}
</ul> </ul>
+1
View File
@@ -30,6 +30,7 @@ main:
url: /collection-archive/ url: /collection-archive/
- title: "External Link" - title: "External Link"
url: https://google.com url: https://google.com
target: _blank
``` ```
Which will give you a responsive masthead similar to this: Which will give you a responsive masthead similar to this: