feat: move all categories card to bottom of category section
All checks were successful
test-build / guarddog (push) Successful in 18s
renovate / renovate (push) Successful in 32s
test-build / build (push) Successful in 1m43s

This commit is contained in:
2026-03-10 23:08:43 -05:00
parent 940342cc3f
commit 2fbc9a764f
3 changed files with 15 additions and 35 deletions

View File

@@ -1,31 +0,0 @@
---
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>

View File

@@ -1,12 +1,15 @@
---
import { readItems } from '@directus/sdk';
import { readItems, readSingleton } from '@directus/sdk';
import type { Post } from '@lib/directusTypes';
import CategoryCard from '@components/cards/CategoryCard.astro';
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 } },
@@ -95,5 +98,16 @@ const categories = (await directus.request(readItems('categories')))
</div>
);
})}
<div class="col-span-full">
<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>
</div>
</section>

View File

@@ -3,7 +3,6 @@ import { readSingleton } from '@directus/sdk';
import HeroSection from '@components/sections/HeroSection.astro';
import CategorySection from '@components/sections/CategorySection.astro';
import AllCategoriesSection from '@components/sections/AllCategoriesSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
@@ -37,8 +36,6 @@ const global = await directus.request(readSingleton('site_global'));
<CategorySection />
<AllCategoriesSection />
</BaseLayout>
<script>