feat: move all categories card to bottom of category section
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user