2022-10-16 09:37:13 +00:00
|
|
|
<template>
|
|
|
|
<NuxtLayout name="blog">
|
2022-10-16 12:50:21 +00:00
|
|
|
<Head>
|
|
|
|
<Title
|
|
|
|
>Archive: {{ route.params.year }} | Evert's Blog | lunasqu.ee</Title
|
|
|
|
>
|
|
|
|
</Head>
|
2022-10-16 11:04:03 +00:00
|
|
|
<BlogArchive :posts="posts" />
|
2022-10-16 09:37:13 +00:00
|
|
|
</NuxtLayout>
|
|
|
|
</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}-archive-page`,
|
2022-10-16 11:04:03 +00:00
|
|
|
params: {
|
|
|
|
year: route.params.year,
|
|
|
|
render: false,
|
|
|
|
},
|
|
|
|
});
|
2022-10-16 09:37:13 +00:00
|
|
|
</script>
|