32 lines
944 B
Plaintext
32 lines
944 B
Plaintext
---
|
|
import { readItems, readSingleton } from '@directus/sdk';
|
|
|
|
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
|
|
import directus from '@lib/directus';
|
|
import { timeago } from '@support/time';
|
|
|
|
const global = await directus.request(readSingleton('site_global'));
|
|
|
|
const posts = await directus.request(
|
|
readItems('posts', {
|
|
filter: { published: { _eq: true } },
|
|
fields: ['*'],
|
|
sort: ['-published_date'],
|
|
})
|
|
);
|
|
---
|
|
|
|
<section class:list={['mx-auto px-4 py-10 sm:px-6 lg:px-8 lg:py-14 lg:pt-10 2xl:max-w-full', Astro.props.className]}>
|
|
<div class="grid grid-cols-1">
|
|
<LargeCategoryCard
|
|
title="All Posts"
|
|
description="Here you can forgoe the organization and browse everything I've posted"
|
|
url="/all"
|
|
logoLight={global.all_logoLight}
|
|
logoDark={global.all_logoDark}
|
|
count={posts.length}
|
|
publishDate={timeago(posts[0]?.published_date)}
|
|
/>
|
|
</div>
|
|
</section>
|