vue-website/pages/blog/[...slug].vue

45 lines
827 B
Vue
Raw Normal View History

2024-07-26 21:37:20 +10:00
<!-- <script>
2024-07-25 21:37:22 +10:00
export default {
async asyncData({ $content, params }) {
const post = await $content('blog', params.slug).fetch()
return { post }
}
}
2024-07-26 21:37:20 +10:00
</script> -->
2024-07-25 21:37:22 +10:00
<template>
<main>
2024-07-26 21:37:20 +10:00
<a href="/"><-- Return Home</a>
<ContentDoc v-slot="{ doc }">
<article class="post">
<h1>{{ doc.title }}</h1>
2024-07-26 22:15:35 +10:00
<p>Date Posted: {{ doc.date }}</p>
2024-07-26 21:37:20 +10:00
<hr/>
<ContentRenderer :value="doc" />
</article>
</ContentDoc>
2024-07-25 21:37:22 +10:00
</main>
2024-07-26 21:37:20 +10:00
<!-- <main>
<ContentSlot :use="$slots.title" unwrap="p" />
<ContentDoc />
</main> -->
</template>
<style>
.post{
width: 80%;
}
main {
display: flex;
flex-direction: column;
align-items: center;
padding: 2rem;
margin-top: 3.5rem;
gap: 2rem;
}
2024-07-26 21:37:20 +10:00
</style>