blog posts loading functional

This commit is contained in:
Clevetop 2024-07-26 21:37:20 +10:00
parent db78dd8066
commit 2656ef7e74
8 changed files with 2077 additions and 30 deletions

View file

@ -1,3 +0,0 @@
<template>
<p>meow~</p>
</template>

View file

@ -1,4 +1,4 @@
<script>
<!-- <script>
export default {
async asyncData({ $content, params }) {
const post = await $content('blog', params.slug).fetch()
@ -6,11 +6,31 @@
return { post }
}
}
</script>
</script> -->
<template>
<main>
<ContentDoc />
<a href="/"><-- Return Home</a>
<ContentDoc v-slot="{ doc }">
<article class="post">
<h1>{{ doc.title }}</h1>
<p>{{ doc.date }}</p>
<hr/>
<ContentRenderer :value="doc" />
</article>
</ContentDoc>
</main>
</template>
<!-- <main>
<ContentSlot :use="$slots.title" unwrap="p" />
<ContentDoc />
</main> -->
</template>
<style>
.post{
width: 80%;
}
</style>