Skip to content

Commit a009df8

Browse files
authored
[DO-565] GitHub buttons hotfix (#31)
* Resolve github links with ufo * Remove unneeded api routes
1 parent 2ced40f commit a009df8

File tree

3 files changed

+9
-58
lines changed

3 files changed

+9
-58
lines changed

components/ep/layout/GithubActions.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@
1616

1717
<script setup lang="ts">
1818
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
19+
import { resolveURL } from 'ufo'
1920
2021
const props = defineProps<{
2122
doc: Pick<ParsedContent, string>
2223
}>()
2324
2425
const githubInfo = useAppConfig().exactproDocs.github!
2526
26-
const { data: editBasePath } = useFetch(
27-
'/api/_docs-toolkit/github/edit-base-path'
27+
const editPath = resolveURL(
28+
githubInfo.repoLink!,
29+
'edit',
30+
githubInfo.branch!,
31+
githubInfo.docsDir!,
32+
props.doc._source,
33+
props.doc._file
2834
)
2935
30-
const editPath = computed(() => {
31-
return `${editBasePath.value}/${props.doc._source}/${props.doc._file}`
32-
})
33-
34-
const createIssuePath = computed(() => {
35-
return `${githubInfo.repoLink}/issues/new/choose`
36-
})
36+
const createIssuePath = resolveURL(githubInfo.repoLink!, '/issues/new/choose')
3737
</script>
3838

3939
<template>

server/routes/api/_docs-toolkit/github/edit-base-path.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

server/routes/api/terms/check-partial.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)