2022-10-16 12:37:13 +03:00
|
|
|
<template>
|
2024-04-20 20:32:12 +03:00
|
|
|
<div style="display: contents">
|
|
|
|
<NuxtLayout name="blog">
|
|
|
|
<template v-for="post of posts">
|
|
|
|
<BlogPost :post="post" :detail="false" />
|
|
|
|
</template>
|
|
|
|
</NuxtLayout>
|
|
|
|
</div>
|
2022-10-16 12:37:13 +03:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-12-04 12:12:29 +02:00
|
|
|
import type { BlogPost } from '~~/lib/types/post';
|
|
|
|
|
|
|
|
const { data: posts } = await useFetch<BlogPost[]>('/api/blog', {
|
2022-10-16 16:28:47 +03:00
|
|
|
key: 'frontpage',
|
2022-10-20 21:52:42 +03:00
|
|
|
params: { limit: 16, render: false },
|
2022-10-16 16:28:47 +03:00
|
|
|
});
|
2022-10-16 12:37:13 +03:00
|
|
|
</script>
|