feat: organize to consistency pass on sections

This commit is contained in:
2026-02-16 22:57:39 -06:00
parent 0497731c45
commit 429cf94023
9 changed files with 38 additions and 35 deletions

View File

@@ -2,6 +2,7 @@
import { Icon } from 'astro-icon/components';
import Logo from '@components/ui/logos/Logo.astro';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
topic: string;
@@ -13,7 +14,8 @@ interface Props {
logoIcon?: string;
}
const { topic, area, date, url, logoUrlLight, logoUrlDark, logoIcon } = Astro.props;
const { topic, area, date, url, logoUrlLight, logoIcon } = Astro.props;
const logoUrlDark = Astro.props.logoUrlDark || logoUrlLight;
---
<div class="smooth-reveal group flex flex-col">
@@ -26,8 +28,8 @@ const { topic, area, date, url, logoUrlLight, logoUrlDark, logoIcon } = Astro.pr
{logoUrlLight ? (
<div class="card-hover-icon-scale mr-5">
<Logo
srcLight={logoUrlLight}
srcDark={logoUrlDark}
srcLight={getDirectusImageURL(logoUrlLight)}
srcDark={getDirectusImageURL(logoUrlDark!)}
alt={`Logo of ${topic}`}
/>
</div>

View File

@@ -2,13 +2,14 @@
import { Icon } from 'astro-icon/components';
import Image from '@components/ui/images/Image.astro';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
title: string;
subTitle: string;
url?: string;
img: any;
imgAlt: any;
url: string;
img: string;
imgAlt: string;
}
const { title, subTitle, url, img, imgAlt } = Astro.props;
@@ -23,7 +24,7 @@ const { title, subTitle, url, img, imgAlt } = Astro.props;
<div>
<Image
class="rounded-xl w-full h-full sm:max-h-80 md:max-h-90 object-cover"
src={img}
src={getDirectusImageURL(img)}
alt={imgAlt}
draggable="false"
loading="lazy"

View File

@@ -2,14 +2,15 @@
import { Icon } from 'astro-icon/components';
import Image from '@components/ui/images/Image.astro';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
title: string;
subTitle: string;
url?: string;
url: string;
single?: boolean;
imgOne?: any;
imgOneAlt?: any;
imgOne: any;
imgOneAlt: any;
imgTwo?: any;
imgTwoAlt?: any;
}
@@ -46,7 +47,7 @@ const { title, subTitle, url, single, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = A
<div>
<Image
class="rounded-xl w-full"
src={imgOne}
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
format="webp"
loading="lazy"
@@ -58,7 +59,7 @@ const { title, subTitle, url, single, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = A
<div class="grid grid-cols-2 gap-4">
<Image
class="rounded-xl w-full"
src={imgOne}
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
draggable="false"
format="webp"
@@ -68,7 +69,7 @@ const { title, subTitle, url, single, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = A
/>
<Image
class="rounded-xl w-full mt-4 lg:mt-10"
src={imgTwo}
src={getDirectusImageURL(imgTwo)}
alt={imgTwoAlt}
draggable="false"
format="webp"

View File

@@ -3,8 +3,8 @@ import { readItems } from '@directus/sdk';
import type { Application } from '@lib/directusTypes';
import directus from '@lib/directus';
import HighlightsCard from '@components/cards/HighlightsCard.astro';
import directus from '@lib/directus';
const applications = ((await directus.request(
readItems('site_applications' as any, {

View File

@@ -3,9 +3,8 @@ import { readItems } from '@directus/sdk';
import type { Education, Certificate} from '@lib/directusTypes';
import directus from '@lib/directus';
import { getDirectusImageURL } from '@lib/directusFunctions';
import EducationCard from '@components/cards/EducationCard.astro';
import directus from '@lib/directus';
const educations = ((await directus.request(
readItems('site_education' as any, {
@@ -37,8 +36,8 @@ const certificates = ((await directus.request(
area={education.area}
date={education.graduationDate}
url={education.url}
logoUrlLight={getDirectusImageURL(education.logo)}
logoUrlDark={getDirectusImageURL(education.logoDark)}
logoUrlLight={education.logo}
logoUrlDark={education.logoDark}
/>
))}
</div>

View File

@@ -1,8 +1,8 @@
---
import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import FeaturesCard from '@components/cards/FeaturesCard.astro';
import directus from '@lib/directus';
const global = await directus.request(readSingleton('site_global'));
---

View File

@@ -3,8 +3,8 @@ import { readItems } from '@directus/sdk';
import type { Project } from '@lib/directusTypes';
import directus from '@lib/directus';
import HighlightsCard from '@components/cards/HighlightsCard.astro';
import directus from '@lib/directus';
const projects = ((await directus.request(
readItems('site_projects' as any, {

View File

@@ -3,7 +3,6 @@ import type { Post } from '@lib/directusTypes';
import LargeBlogLeftCard from '@components/cards/LargeBlogLeftCard.astro';
import LargeBlogRightCard from '@components/cards/LargeBlogRightCard.astro';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
posts: Post[];
@@ -13,24 +12,24 @@ const { posts } = Astro.props;
---
<section class="smooth-reveal">
{posts.map((b, index) => index % 2 === 0 ? (
{posts.map((post, index) => index % 2 === 0 ? (
<LargeBlogLeftCard
title={b.title}
subTitle={b.description}
url={`/blog/${b.slug}`}
img={getDirectusImageURL(b.image)}
imgAlt={b.image_alt}
title={post.title}
subTitle={post.description}
url={`/blog/${post.slug}`}
img={post.image}
imgAlt={post.image_alt}
/>
) : (
<LargeBlogRightCard
title={b.title}
subTitle={b.description}
url={`/blog/${b.slug}`}
single={!b.image_second}
imgOne={getDirectusImageURL(b.image)}
imgOneAlt={b.image_alt}
imgTwo={getDirectusImageURL(b?.image_second)}
imgTwoAlt={b?.image_second_alt}
title={post.title}
subTitle={post.description}
url={`/blog/${post.slug}`}
single={!post.image_second}
imgOne={post.image}
imgOneAlt={post.image_alt}
imgTwo={post?.image_second}
imgTwoAlt={post?.image_second_alt}
/>
))}
</section>

View File

@@ -3,6 +3,7 @@ import WeatherCard from '@components/cards/WeatherCard.astro';
import { getFiveDayForecast } from '@support/weather';
const { latitude = "44.95", longitude = "-93.09", cityName = "St. Paul, Minnesota", timezone = "America/Chicago" } = Astro.props;
const { forecastDays, error } = await getFiveDayForecast(latitude, longitude, timezone);
---