Skip to content

Commit

Permalink
feat: add link prop if link is internal
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Feb 26, 2021
1 parent 6ec0a43 commit 4eb6a81
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions components/utils/ContentContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,25 @@
<template v-if="links.length">
<div>
<template v-for="(link, index) in links">
<a
:key="link.text"
:href="link.href"
target="_blank"
rel="noopener"
class="text-sm"
>
{{ link.text }}
</a>
<!-- Internal link -->
<template v-if="link.isInternal">
<NuxtLink :key="link.text" :to="link.href" class="text-sm">
{{ link.text }}
</NuxtLink>
</template>

<!-- External link -->
<template v-else>
<a
:key="link.text"
:href="link.href"
target="_blank"
rel="noopener"
class="text-sm"
>
{{ link.text }}
</a>
</template>

<!-- Separator -->
<template v-if="index !== links.length - 1"> - </template>
Expand Down

0 comments on commit 4eb6a81

Please sign in to comment.