lunasqu.ee-nuxt/pages/blog/archive/[year]/[month]/index.vue

28 lines
654 B
Vue
Raw Permalink Normal View History

2022-10-16 09:37:13 +00:00
<template>
2024-04-20 17:32:12 +00:00
<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>
2022-10-16 09:37:13 +00:00
</template>
<script setup lang="ts">
2022-10-16 11:04:03 +00:00
import type { BlogPost } from '~~/lib/types/post';
2022-10-16 09:37:13 +00:00
const route = useRoute();
2022-10-16 11:34:04 +00:00
const { data: posts } = await useFetch<BlogPost[]>(`/api/blog`, {
key: `${route.params.year}-${route.params.month}-page`,
2022-10-16 11:04:03 +00:00
params: {
year: route.params.year,
month: route.params.month,
render: false,
},
});
2022-10-16 09:37:13 +00:00
</script>