Skip to content

Commit

Permalink
Add target attribute for navigation link (mmistakes#3056)
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz authored and minyoongi96 committed Aug 26, 2024
1 parent ffd067c commit 829d3cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
*~
*.sw[p_]

# IntelliJ IDEA
*.idea

# Sublime Text
*.sublime-project
*.sublime-workspace
Expand Down
6 changes: 5 additions & 1 deletion _includes/masthead.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions docs/_docs/07-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 829d3cf

Please sign in to comment.