fix: use base in links (#717) (#718)

pull/723/head
Divyansh Singh 2 years ago committed by GitHub
parent 31c863d14c
commit 8e5015462c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import { withBase } from 'vitepress'
const props = defineProps<{
tag?: string
@ -30,7 +31,7 @@ const component = computed(() => {
:is="component"
class="VPButton"
:class="classes"
:href="href"
:href="href ? withBase(href) : undefined"
:target="isExternal ? '_blank' : undefined"
:rel="isExternal ? 'noopener noreferrer' : undefined"
>

@ -8,7 +8,7 @@ const { hasSidebar } = useSidebar()
<template>
<div class="VPNavBarTitle" :class="{ 'has-sidebar': hasSidebar }">
<a class="title" href="/">
<a class="title" :href="site.base">
<img v-if="theme.logo" class="logo" :src="theme.logo">
<template v-if="theme.siteTitle">{{ theme.siteTitle }}</template>
<template v-else-if="theme.siteTitle === undefined">{{ site.title }}</template>

Loading…
Cancel
Save