d5bd3e3be2
surely this will not be a problem later
43 lines
884 B
Vue
43 lines
884 B
Vue
<script setup lang="ts">
|
|
import type { StoryParsedContent } from "@/shared/types";
|
|
|
|
useTitle("Stories", "Fantasies and worlds");
|
|
//definePageMeta({ layout: "withtop" });
|
|
|
|
// TODO: paginate stories
|
|
const docs = await queryContent<StoryParsedContent>("/stories")
|
|
.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">Stories</h1>
|
|
<div class="m-0">
|
|
Filter:
|
|
<Tag
|
|
:dest="`/tags/stories/${tag}`"
|
|
v-for="(tag, index) in tags"
|
|
:key="index"
|
|
:name="tag"
|
|
/>
|
|
</div>
|
|
<PostPreviewCard
|
|
v-for="(story, index) in docs"
|
|
:key="index"
|
|
:post="story"
|
|
type="stories"
|
|
/>
|
|
</main>
|
|
</template>
|