lunasqu.ee-nuxt/pages/blog/archive/[year]/[month]/index.vue
2024-04-20 20:32:12 +03:00

28 lines
654 B
Vue

<template>
<div style="display: contents">
<NuxtLayout name="blog">
<Head>
<Title
>Archive: {{ route.params.year }}/{{ route.params.month }} | Evert's
Blog | lunasqu.ee</Title
>
</Head>
<BlogArchive :posts="posts" />
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
import type { BlogPost } from '~~/lib/types/post';
const route = useRoute();
const { data: posts } = await useFetch<BlogPost[]>(`/api/blog`, {
key: `${route.params.year}-${route.params.month}-page`,
params: {
year: route.params.year,
month: route.params.month,
render: false,
},
});
</script>