diff --git a/components/docs/EditOnLink.vue b/components/docs/EditOnLink.vue index c1e7dfdc2..a23c98d32 100644 --- a/components/docs/EditOnLink.vue +++ b/components/docs/EditOnLink.vue @@ -6,6 +6,14 @@ import { useAppConfig } from '#imports' export default defineComponent({ props: { + /** + * GitHub base URL. + */ + baseUrl: { + type: String, + default: () => useAppConfig()?.docus?.github?.baseUrl || 'https://github.com', + required: false + }, /** * Repository owner. */ @@ -81,7 +89,7 @@ export default defineComponent({ } const source = computed(() => { - let { repo, owner, branch, contentDir } = props + let { baseUrl, repo, owner, branch, contentDir } = props let prefix = '' // Resolve source from content sources @@ -105,10 +113,10 @@ export default defineComponent({ } } - return { repo, owner, branch, contentDir, prefix } + return { baseUrl, repo, owner, branch, contentDir, prefix } }) - const base = computed(() => joinURL('https://github.com', `${source.value.owner}/${source.value.repo}`)) + const base = computed(() => joinURL(`${source.value.baseUrl}/${source.value.owner}/${source.value.repo}`)) const path = computed(() => { const dirParts: string[] = [] diff --git a/nuxt.schema.ts b/nuxt.schema.ts index 69f460e4e..998845554 100644 --- a/nuxt.schema.ts +++ b/nuxt.schema.ts @@ -286,6 +286,12 @@ export default defineNuxtSchema({ * @studioIcon simple-icons:github */ github: { + /** + * Base URL + * + * You can use this to link to GitHub Enterprise. + */ + baseUrl: 'https://github.com', /** * Directory *