diff --git a/app/components/Button/CopyMd.vue b/app/components/Button/CopyMd.vue new file mode 100644 index 0000000000..5ada98c13e --- /dev/null +++ b/app/components/Button/CopyMd.vue @@ -0,0 +1,67 @@ + + diff --git a/app/components/Changelog/Card.vue b/app/components/Changelog/Card.vue index 307a2ae7c1..83eef12638 100644 --- a/app/components/Changelog/Card.vue +++ b/app/components/Changelog/Card.vue @@ -3,8 +3,10 @@ import type { IconClass } from '~/types' import type { ReleaseData } from '~~/shared/types/changelog' import { slugify } from '~~/shared/utils/html' -const { release } = defineProps<{ +const { release, baseUrl, host } = defineProps<{ release: ReleaseData + baseUrl: string + host?: string }>() const formattedDate = computed(() => { if (!release.publishedAt) { @@ -28,6 +30,19 @@ const { providerIcon, viewOnProvider } = inject<{ providerIcon: 'i-lucide:code', viewOnProvider: computed(() => $t('common.view_on.git_repo')), }) + +// fetch markdown to copy +const { + data: markdown, + execute: fetchMarkdown, + status: mdStatus, +} = useLazyFetch(() => `${baseUrl}/raw/${encodeURIComponent(release.tag)}`, { + immediate: false, + server: false, + query: { + host: computed(() => host), + }, +})