Skip to content

Commit

Permalink
Open External Header Links in New Tab (#72)
Browse files Browse the repository at this point in the history
* open outgoing links in new tab

* fix public url type erorr

* Simplify

* Remove unused import

* No longer needed

---------

Co-authored-by: rijkvanzanten <[email protected]>
  • Loading branch information
bryantgillespie and rijkvanzanten authored Sep 18, 2023
1 parent 67b5977 commit 4b52f45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/Nav/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ watch(
v-if="section.url || (section.page as any)?.permalink"
:href="(section.page as any)?.permalink ?? section.url ?? undefined"
class="section-title"
:target="!section.page && section.url ? '_blank' : undefined"
>
{{ section.title }}
</NuxtLink>
Expand All @@ -143,7 +144,11 @@ watch(
<div v-if="section.children_title" class="subsection-title">{{ section.children_title }}</div>
<ul v-if="section.children && section.children.length > 0">
<li v-for="link in section.children" :key="link.id">
<NuxtLink :href="(link.page as any)?.permalink ?? link.url ?? undefined" class="link">
<NuxtLink
:href="(link.page as any)?.permalink ?? link.url ?? undefined"
class="link"
:target="!link.page && link.url ? '_blank' : undefined"
>
<BaseDirectusImage
v-if="link.image"
:uuid="(link.image as string)"
Expand Down

0 comments on commit 4b52f45

Please sign in to comment.