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

24 lines
515 B
Vue

<template>
<NuxtLayout name="blog">
<Head>
<Title
>Archive: {{ route.params.year }} | Evert's Blog | lunasqu.ee</Title
>
</Head>
<BlogArchive :posts="posts" />
</NuxtLayout>
</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}-archive-page`,
params: {
year: route.params.year,
render: false,
},
});
</script>