fix layout
This commit is contained in:
@@ -5,21 +5,9 @@ interface Props {
|
|||||||
description: string;
|
description: string;
|
||||||
count: number;
|
count: number;
|
||||||
publishDate: string;
|
publishDate: string;
|
||||||
layoutPattern?: {
|
|
||||||
smCol: number;
|
|
||||||
mdCol: number;
|
|
||||||
row: number;
|
|
||||||
index: number;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { slug, layoutPattern, title, description, count, publishDate } = Astro.props;
|
const { slug, title, description, count, publishDate } = Astro.props;
|
||||||
const isSingleItem =
|
|
||||||
layoutPattern &&
|
|
||||||
layoutPattern.row === 1 &&
|
|
||||||
(layoutPattern.smCol === 1 || layoutPattern.mdCol === 1);
|
|
||||||
|
|
||||||
const formatedDescription = isSingleItem ? `No description available` : description;
|
|
||||||
|
|
||||||
const baseClasses =
|
const baseClasses =
|
||||||
'group group-hover rounded-xl flex h-full min-h-[220px] cursor-pointer flex-col overflow-hidden';
|
'group group-hover rounded-xl flex h-full min-h-[220px] cursor-pointer flex-col overflow-hidden';
|
||||||
@@ -32,17 +20,17 @@ const bgColorClasses =
|
|||||||
<div
|
<div
|
||||||
class={`relative min-h-0 flex-grow overflow-hidden transition-all duration-300 ${bgColorClasses}`}
|
class={`relative min-h-0 flex-grow overflow-hidden transition-all duration-300 ${bgColorClasses}`}
|
||||||
>
|
>
|
||||||
<div class="absolute inset-1 flex flex-col justify-end p-3 md:p-4 lg:p-5">
|
<div class="absolute inset-1 flex flex-col p-3 md:p-4 lg:p-5">
|
||||||
|
<div class="overflow-hidden">
|
||||||
<h2
|
<h2
|
||||||
class="group-hover:text-steel dark:group-hover:text-bermuda transition-text mb-4 text-4xl font-extrabold tracking-tight text-balance text-neutral-800 duration-300 dark:text-neutral-200"
|
class="group-hover:text-steel dark:group-hover:text-bermuda transition-text mb-4 text-4xl font-extrabold tracking-tight text-balance whitespace-nowrap text-neutral-800 duration-300 dark:text-neutral-200"
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</h2>
|
</h2>
|
||||||
<p
|
<p class="mb-4 font-light text-neutral-600 sm:text-lg dark:text-neutral-400">
|
||||||
class=`mb-4 ${isSingleItem ? 'hidden lg:block' : ''} max-w-prose text-pretty font-light text-neutral-600 dark:text-neutral-400 sm:text-lg`
|
{description}
|
||||||
>
|
|
||||||
{formatedDescription}
|
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mt-auto flex items-center justify-between pt-1 text-xs text-neutral-600 md:pt-2 dark:text-neutral-300"
|
class="mt-auto flex items-center justify-between pt-1 text-xs text-neutral-600 md:pt-2 dark:text-neutral-300"
|
||||||
>
|
>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: 'Cloud ☁️'
|
title: 'Cloud ☁️'
|
||||||
description: "Its just someone else's server"
|
description: 'Its just someone else's server'
|
||||||
---
|
---
|
||||||
|
5
src/env.d.ts
vendored
5
src/env.d.ts
vendored
@@ -1,8 +1,3 @@
|
|||||||
<<<<<<< HEAD
|
|
||||||
/// <reference path="../.astro/types.d.ts" />
|
/// <reference path="../.astro/types.d.ts" />
|
||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
/// <reference types="astro/content" />
|
/// <reference types="astro/content" />
|
||||||
=======
|
|
||||||
/// <reference types="astro/client" />
|
|
||||||
/// <reference path="../.astro/types.d.ts" />
|
|
||||||
>>>>>>> 184f0c7 (fix path)
|
|
||||||
|
@@ -118,7 +118,6 @@ const description =
|
|||||||
description={category.data.description}
|
description={category.data.description}
|
||||||
count={postMap.get(category.slug)?.length ?? 0}
|
count={postMap.get(category.slug)?.length ?? 0}
|
||||||
publishDate={timeago(postMap.get(category.slug)?.[0]?.published_date)}
|
publishDate={timeago(postMap.get(category.slug)?.[0]?.published_date)}
|
||||||
layoutPattern={category.layoutPattern}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@@ -11,7 +11,8 @@ import homeImg from '@images/autumn_mountain.png';
|
|||||||
|
|
||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
|
|
||||||
const description = 'Engineering the cloud by day, homelab by night, and exploring Minnesota in between.';
|
const description =
|
||||||
|
'Engineering the cloud by day, homelab by night, and exploring Minnesota in between.';
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout
|
<BaseLayout
|
||||||
|
Reference in New Issue
Block a user