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

63 lines
1.1 KiB
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>
2025-04-05 19:10:15 +11:00
<!-- <a href="javascript:window.history.back();"><-- Go Back</a> -->
<BigButton text="<<< Return to blog listing" href="/blog-index"/>
2024-07-26 21:37:20 +10:00
<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>
2025-04-05 20:02:54 +11:00
<style scoped>
2024-07-26 21:37:20 +10:00
.post{
2025-04-05 19:10:15 +11:00
width: 50%;
}
/* i wonder if this will cause issues */
img{
width: 100%;
2025-04-05 20:02:54 +11:00
2025-04-05 19:10:15 +11:00
}
@media (max-width: 1000px){
.post{
width: 80%;
}
img{
width: 100%;
}
2024-07-26 21:37:20 +10:00
}
main {
display: flex;
flex-direction: column;
align-items: center;
padding: 2rem;
margin-top: 3.5rem;
2025-04-05 19:01:47 +11:00
/* gap: 2rem; */
}
2024-07-26 21:37:20 +10:00
</style>