chore: upgrade to nuxt 4
This commit is contained in:
42
app/pages/blog.vue
Normal file
42
app/pages/blog.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import type { BlogParsedContent } from "@/shared/types";
|
||||
|
||||
useTitle("Blog", "Ramblings and ideas");
|
||||
//definePageMeta({ layout: "withtop" });
|
||||
|
||||
// TODO: paginate stories
|
||||
const docs = await queryContent<BlogParsedContent>("/blog")
|
||||
.sort({ date: -1 })
|
||||
.where({ _draft: false })
|
||||
.find();
|
||||
|
||||
const tags = new Set(
|
||||
docs
|
||||
.map((p) => p.tags)
|
||||
.flat()
|
||||
.sort()
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main
|
||||
class="flex flex-col grow prose dark:prose-invert max-w-3xl gap-6 transition"
|
||||
>
|
||||
<h1 class="mb-0">Blog</h1>
|
||||
<div class="m-0">
|
||||
Filter:
|
||||
<Tag
|
||||
:dest="`/tags/blog/${tag}`"
|
||||
v-for="(tag, index) in tags"
|
||||
:key="index"
|
||||
:name="tag"
|
||||
/>
|
||||
</div>
|
||||
<PostPreviewCard
|
||||
v-for="(post, index) in docs"
|
||||
:key="index"
|
||||
:post
|
||||
type="blog"
|
||||
/>
|
||||
</main>
|
||||
</template>
|
Reference in New Issue
Block a user