Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 9b9b50c

Browse files
committed
docs: add open an issue link
fix #173
1 parent 83cd7fc commit 9b9b50c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.vitepress/theme/components/AsideOutlineAfter.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts" setup>
22
import { useRoute } from 'vitepress'
33
import { computed } from 'vue'
4+
import { withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
45
56
const route = useRoute()
67
@@ -21,18 +22,21 @@ const show = computed(() => {
2122
})
2223
2324
const componentPath = computed(() => {
24-
return route.path.replace('/index.md', '')
25+
return withoutTrailingSlash(withoutLeadingSlash(route.path.replace('/index.md', '')))
2526
})
2627
2728
const componentName = computed(() => {
2829
return componentPath.value.split('/').pop()
2930
})
3031
3132
const viewComponent = computed(() => {
32-
return `https://github.com/barbapapazes-sponsors/vue-ui/blob/main/src${componentPath.value}`
33+
return `https://github.com/barbapapazes-sponsors/vue-ui/blob/main/src/${componentPath.value}`
3334
})
3435
const editComponent = computed(() => {
35-
return `https://github.com/barbapapazes-sponsors/vue-ui/edit/main/src${componentPath.value}/${componentName.value}.vue`
36+
return `https://github.com/barbapapazes-sponsors/vue-ui/edit/main/src/${componentPath.value}/${componentName.value}.vue`
37+
})
38+
const openIssue = computed(() => {
39+
return `https://github.com/barbapapazes-sponsors/vue-ui/issues/new?title=[${componentName.value}]%20`
3640
})
3741
</script>
3842

@@ -47,6 +51,11 @@ const editComponent = computed(() => {
4751
View on GitHub
4852
</a>
4953

54+
<a :href="openIssue" target="_blank" class="flex flex-row items-center text-(--vp-c-text-2)! text-sm transition-colors duration-[250ms] leading-8 hover:text-(--vp-c-text-1)!">
55+
<span class="i-lucide-message-square mr-2 size-4" />
56+
Open an issue
57+
</a>
58+
5059
<a :href="editComponent" target="_blank" class="flex flex-row items-center text-(--vp-c-text-2)! text-sm transition-colors duration-[250ms] leading-8 hover:text-(--vp-c-text-1)!">
5160
<span class="i-lucide-pen mr-2 size-4" />
5261
Edit the component

0 commit comments

Comments
 (0)