blog posts loading functional
This commit is contained in:
parent
db78dd8066
commit
2656ef7e74
8 changed files with 2077 additions and 30 deletions
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue