feat(theme): allow internal social links

closes #5305
pull/4393/merge
Divyansh Singh 2 months ago
parent 225c94afd2
commit 51ff681f4e

@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { computed, nextTick, onMounted, ref, useSSRContext } from 'vue'
import type { SSGContext } from '../../shared'
import { isExternal, type SSGContext } from '../../shared'
const props = defineProps<{
icon: DefaultTheme.SocialLinkIcon
@ -46,7 +46,7 @@ if (import.meta.env.SSR) {
class="VPSocialLink no-icon"
:href="link"
:aria-label="ariaLabel ?? (typeof icon === 'string' ? icon : '')"
:target="target ?? '_blank'"
:target="target ?? (isExternal(link) ? '_blank' : undefined)"
:rel="me ? 'me noopener' : 'noopener'"
v-html="svg"
></a>

Loading…
Cancel
Save