Skip to content

Commit

Permalink
fix: use base in links (#717) (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Jun 4, 2022
1 parent 31c863d commit 8e50154
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/client/theme-default/components/VPButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import { withBase } from 'vitepress'
const props = defineProps<{
tag?: string
Expand Down Expand Up @@ -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"
>
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPNavBarTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 8e50154

Please sign in to comment.