2022-07-22 17:16:27 -04:00
|
|
|
<script setup lang="ts">
|
2022-08-10 16:31:25 -04:00
|
|
|
import type { BlogParsedContent } from "@/shared/types";
|
|
|
|
|
2022-08-07 11:37:29 -04:00
|
|
|
useTitle("Blog");
|
2022-08-10 16:31:25 -04:00
|
|
|
|
|
|
|
// TODO: paginate stories
|
|
|
|
const docs = await queryContent<BlogParsedContent>("/blog")
|
|
|
|
.sort({ date: -1 })
|
|
|
|
.where({ _draft: false })
|
|
|
|
.find();
|
2022-07-22 17:16:27 -04:00
|
|
|
</script>
|
|
|
|
|
2022-08-10 16:31:25 -04:00
|
|
|
<template>
|
|
|
|
<main
|
|
|
|
class="flex flex-col grow prose dark:prose-invert max-w-3xl gap-6 transition"
|
|
|
|
>
|
|
|
|
<h1 class="mb-0">Blog</h1>
|
|
|
|
<PostPreviewCard
|
|
|
|
v-for="(post, index) in docs"
|
|
|
|
:key="index"
|
|
|
|
:post="post"
|
|
|
|
type="blog"
|
|
|
|
/>
|
|
|
|
</main>
|
|
|
|
</template>
|