Skip to content

Commit f7bb41a

Browse files
committed
feat: 支持下载源文件
1 parent 14bd4c6 commit f7bb41a

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

components/settings/PdfDownload.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<NPopover trigger="hover" placement="right">
3+
<template #trigger>
4+
<div class="bg-stone-100 hover:bg-stone-50 dark:bg-stone-800 dark:hover:bg-stone-700 rounded-full shadow h-14 w-14 p-3.5 text-gray-500 hover:text-gray-900 hover:dark:text-gray-300">
5+
<NuxtLink target="_blank" :to="link"><Icon class="w-full h-full" name="carbon:generate-pdf"></Icon></NuxtLink>
6+
</div>
7+
</template>
8+
下载 PDF 原版文件
9+
</NPopover>
10+
</template>
11+
<script setup lang="ts">
12+
defineProps<{
13+
link: string
14+
}>()
15+
</script>

content/xifangquezhi.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: '西方确指'
33
description: '庐山东林寺印经处 印赠'
4+
download_link: https://file.hufasi.com/%E8%A5%BF%E6%96%B9%E7%A1%AE%E6%8C%87%EF%BC%88%E4%B8%9C%E6%9E%97%E7%89%88%E6%89%AB%E6%8F%8F%EF%BC%892020.6.16.pdf
45
---
56

67
::cover

pages/[...slug].vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<ContentDoc class="p-10 leading-relaxed bg-neutral-50 dark:bg-neutral-800 " :class="`text-${fontSize} paragraph-${fontSize}`" />
66
<div class="relative mb-3">
77
<div class="fixed bottom-3 flex flex-col gap-3">
8-
<SettingsColorMode class="bg-stone-100 hover:bg-stone-50 dark:bg-stone-800 dark:hover:bg-stone-700 rounded-full shadow h-14 w-14" />
8+
<SettingsPdfDownload v-if="page?.download_link" :link="page.download_link" />
9+
<SettingsColorMode class="" />
910
<SettingsFontSize
10-
class="bg-stone-100 hover:bg-stone-50 dark:bg-stone-800 dark:hover:bg-stone-700 rounded-full shadow"
1111
:default-value="fontSize"
1212
@change="(value) => fontSize = value"
1313
/>

0 commit comments

Comments
 (0)