Skip to content

Commit 0248bd4

Browse files
committed
fix: CardLink link resolution with base
Signed-off-by: Sergej Atamantschuk <[email protected]>
1 parent fc46ebd commit 0248bd4

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.vitepress/theme/components/Base/CardLink.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<script setup lang="ts">
2-
defineProps<{
2+
import { useData } from "vitepress";
3+
import { computed } from "vue";
4+
5+
const { link } = defineProps<{
36
title: string;
47
link: string;
58
}>();
9+
10+
const data = useData();
11+
12+
const normalizedLink = computed(() => {
13+
return `${data.site.value.base}${link}`;
14+
});
615
</script>
716

817
<template>
918
<a
10-
:href="link"
19+
:href="normalizedLink"
1120
class="h-full block max-w-sm p-4 bg-gray-100 rounded-lg hover:bg-gray-200 dark:bg-zinc-800 dark:hover:bg-zinc-700 no-underline"
1221
style="text-decoration: none"
1322
>

guide/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ createApp(App).use(veProgress);
2323

2424
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-10">
2525
<div>
26-
<CardLink link="/guide/installation.html" title="Installation options">
26+
<CardLink link="guide/installation.html" title="Installation options">
2727
Learn what possibilities you have to include the component in your project
2828
</CardLink>
2929
</div>
3030
<div>
31-
<CardLink class="fill" link="/guide/options/" title="Configuration">
31+
<CardLink class="fill" link="guide/options/" title="Configuration">
3232
Explore wide range of configuration options through the properties and slots
3333
</CardLink>
3434
</div>
3535
<div>
36-
<CardLink link="/guide/compatibility.html" title="Compatibility">
36+
<CardLink link="guide/compatibility.html" title="Compatibility">
3737
Check, if the plugin meets your compatibility requirements
3838
</CardLink>
3939
</div>
4040
<div>
41-
<CardLink class="fill" link="/guide/contribution.html" title="Contribution">
41+
<CardLink class="fill" link="guide/contribution.html" title="Contribution">
4242
Any help is very much appreciated
4343
</CardLink>
4444
</div>

0 commit comments

Comments
 (0)