Add target attribute for navigation link (#3056)

This commit is contained in:
Dmitriy Derepko 2024-05-05 16:12:37 +07:00 committed by GitHub
parent f1ffad4b5e
commit ceeda03132
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

3
.gitignore vendored
View File

@ -2,6 +2,9 @@
*~
*.sw[p_]
# IntelliJ IDEA
*.idea
# Sublime Text
*.sublime-project
*.sublime-workspace

View File

@ -14,7 +14,11 @@
<ul class="visible-links">
{%- for link in site.data.navigation.main -%}
<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>
{%- endfor -%}
</ul>

View File

@ -30,6 +30,7 @@ main:
url: /collection-archive/
- title: "External Link"
url: https://google.com
target: _blank
```
Which will give you a responsive masthead similar to this: