feat: 引入 @nuxt/content

This commit is contained in:
2025-06-06 01:33:40 +08:00
parent e558f44ac0
commit dade6466bb
6 changed files with 1643 additions and 69 deletions

13
content.config.ts Normal file
View File

@@ -0,0 +1,13 @@
import { defineCollection, defineContentConfig, z } from "@nuxt/content";
export default defineContentConfig({
collections: {
download: defineCollection({
source: "download/*.md",
type: "page",
schema: z.object({
rawbody: z.string(),
}),
}),
},
});

18
content/download/faq.md Normal file
View File

@@ -0,0 +1,18 @@
### 对于 Ubuntu 20.04 用户
1. **下载依赖包**
- 请访问[星火应用商店依赖包下载页面](https://gitee.com/spark-store-project/spark-store-dependencies/releases/tag/1.0),下载最新的依赖包。
- 请多次解压依赖包,直到你可以看到诸多以 deb 结尾的安装包。
- 请根据依赖包内的说明,一次性安装所有的依赖包。
2. **下载并安装**
如果你已经正确选择了正确的计算机架构amd64、arm64 或 loong64点击下一步将自动下载最新版本的星火应用商店安装包。
假设您下载到用户目录下的 Downloads 文件夹,我们推荐您使用 APT 工具安装:
```bash
cd ~/Downloads
sudo apt install ./spark-store-\*.deb
```

View File

@@ -12,6 +12,7 @@ export default defineNuxtConfig({
"@nuxt/image",
"@primevue/nuxt-module",
"@nuxtjs/fontaine",
"@nuxt/content",
],
icon: {
mode: "css",
@@ -144,4 +145,4 @@ document.documentElement.classList.toggle("s-dark", sDarkValue);`,
},
},
},
});
});

View File

@@ -12,6 +12,7 @@
"dependencies": {
"@iconify-json/line-md": "^1.2.8",
"@iconify-json/proicons": "^1.2.16",
"@nuxt/content": "3.5.1",
"@nuxt/eslint": "1.4.1",
"@nuxt/icon": "1.13.0",
"@nuxt/image": "1.10.0",
@@ -38,6 +39,7 @@
"onlyBuiltDependencies": [
"@parcel/watcher",
"@tailwindcss/oxide",
"better-sqlite3",
"esbuild",
"sharp",
"unrs-resolver"

View File

@@ -19,26 +19,6 @@ const dialog = ref(false);
const downloadStarted = ref(false);
const faqContent = ref(
`### 对于 Ubuntu 20.04 用户
1. **下载依赖包**
- 请访问[星火应用商店依赖包下载页面](https://gitee.com/spark-store-project/spark-store-dependencies/releases/tag/1.0),下载最新的依赖包。
- 请多次解压依赖包,直到你可以看到诸多以 deb 结尾的安装包。
- 请根据依赖包内的说明,一次性安装所有的依赖包。
2. **下载并安装**
如果你已经正确选择了正确的计算机架构amd64、arm64 或 loong64点击下一步将自动下载最新版本的星火应用商店安装包。
假设您下载到用户目录下的 Downloads 文件夹,我们推荐您使用 APT 工具安装:
\`\`\`bash
cd ~/Downloads
sudo apt install ./spark-store-*.deb
\`\`\`
`
);
const startDownload = () => {
downloadStarted.value = true;
if (selectedArch.value === "loong64") {
@@ -111,6 +91,14 @@ const consoleDownloadUrl = computed(() => {
}
return "";
});
const { data: faqContent } = await useAsyncData("/download/faq", () => {
return queryCollection("download").path("/download/faq").first();
});
onMounted(() => {
console.log(faqContent.value);
});
</script>
<template>
@@ -316,7 +304,7 @@ const consoleDownloadUrl = computed(() => {
}"
>
<MdPreview
:model-value="faqContent"
:model-value="faqContent?.rawbody.replaceAll('\\n', '\n') || ''"
:theme="sDark ? 'dark' : 'light'"
preview-theme="github"
/>

1646
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff