feat: ensure `.html` extension in rendered nav links (#175)

close #175
pull/654/head
Kia Ishii 3 years ago
parent b8c76ba47b
commit ef3e44c5a2

@ -1,5 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue' import { computed } from 'vue'
import { normalizeLink } from '../support/utils'
import VPIconExternalLink from './icons/VPIconExternalLink.vue' import VPIconExternalLink from './icons/VPIconExternalLink.vue'
const props = defineProps<{ const props = defineProps<{
@ -15,7 +16,7 @@ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
:is="href ? 'a' : 'span'" :is="href ? 'a' : 'span'"
class="VPLink" class="VPLink"
:class="{ link: href }" :class="{ link: href }"
:href="href" :href="href ? normalizeLink(href) : undefined"
:target="isExternal ? '_blank' : undefined" :target="isExternal ? '_blank' : undefined"
:rel="isExternal ? 'noopener noreferrer' : undefined" :rel="isExternal ? 'noopener noreferrer' : undefined"
> >

Loading…
Cancel
Save