初始化:创建基于 Nuxt Content 的博客项目

This commit is contained in:
zibright
2025-07-22 16:15:28 +08:00
commit 0e18cc8790
9 changed files with 10050 additions and 0 deletions

11
pages/[...slug].vue Normal file
View File

@@ -0,0 +1,11 @@
<template>
<article class="prose lg:prose-xl mx-auto">
<ContentDoc />
</article>
</template>
<style>
.prose {
max-width: 65ch;
margin: 0 auto;
}

18
pages/index.vue Normal file
View File

@@ -0,0 +1,18 @@
<template>
<div>
<h1 class="text-4xl font-bold mb-8">最新文章</h1>
<div class="grid gap-6">
<ContentList path="/" v-slot="{ list }">
<div v-for="article in list" :key="article._path" class="bg-white shadow rounded-lg p-6">
<NuxtLink :to="article._path">
<h2 class="text-2xl font-bold mb-2">{{ article.title }}</h2>
<p class="text-gray-600">{{ article.description }}</p>
<div class="mt-4 text-sm text-gray-500">
{{ new Date(article.date).toLocaleDateString() }}
</div>
</NuxtLink>
</div>
</ContentList>
</div>
</div>
</template>