Skip to content

Commit 6aa4af5

Browse files
committed
Add "Help improve this page" GitHub edit link to documentation pages
1 parent d34f6c4 commit 6aa4af5

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • app/pages/open-source/packages/[slug]/docs/[version]

app/pages/open-source/packages/[slug]/docs/[version]/[...path].vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ const title = computed(() => {
6767
return match ? match[1] : pkg.name
6868
})
6969
70+
const gitHubFileUrl = computed(() => {
71+
const branch = pkgVersion!.gitBranch || pkgVersion!.version
72+
return `https://github.com/${pkg.github.owner}/${pkg.github.repo}/edit/${branch}/docs/${docPath}.md`
73+
})
74+
7075
useSeoMeta({
7176
title: `${title.value} | ${pkg.name} ${pkgVersion!.version} Documentation`,
7277
})
@@ -210,6 +215,18 @@ onUnmounted(() => {
210215
<MDC class="docs-content" :value="docData?.content ?? ''" tag="div" />
211216
</div>
212217
</div>
218+
219+
<div class="mt-4 text-right text-sm">
220+
<a
221+
:href="gitHubFileUrl"
222+
target="_blank"
223+
rel="noopener noreferrer"
224+
class="hover:text-brand-orange inline-flex items-center gap-1 text-gray-500 transition-colors duration-200"
225+
>
226+
<Icon name="fa7-brands:github" class="h-4 w-4 fill-current" />
227+
Help improve this page
228+
</a>
229+
</div>
213230
</main>
214231
</div>
215232
</div>

0 commit comments

Comments
 (0)