update about and remove strapi
All checks were successful
Deployment / Deploy website (push) Successful in 3m58s
Deployment / Deploy strapi (push) Successful in 3m10s

This commit is contained in:
Benjamin Palko 2025-06-18 13:53:13 -04:00
parent 342a0bffdb
commit 009ec42f3d
8 changed files with 61 additions and 75 deletions

View file

@ -5,7 +5,7 @@
import '../app.css';
import type { LayoutProps } from './$types';
let { children, data }: LayoutProps = $props();
let { children }: LayoutProps = $props();
let drawerOpen = $state(false);
@ -30,11 +30,11 @@
let current = $derived(pages.find((p) => p.slug === page.route.id));
</script>
<div class="drawer drawer-end bg-cover" style:background-image={`url(${data.background.url})`}>
<div class="drawer drawer-end">
<input id="navigation-drawer" type="checkbox" class="drawer-toggle" bind:checked={drawerOpen} />
<div class="drawer-content h-screen w-screen overflow-y-scroll lg:p-12">
<div
class="bg-base-100 border-base-300 mx-auto grid min-h-full max-w-7xl grid-rows-[max-content_max-content_auto_max-content] overflow-hidden border-2 shadow-md lg:gap-4 lg:rounded-4xl"
class="bg-base-100/90 border-base-300 mx-auto grid min-h-full max-w-7xl grid-rows-[max-content_max-content_auto_max-content] overflow-hidden border-2 shadow-md lg:gap-4 lg:rounded-4xl"
>
<header class="lg:p-6">
<Navbar drawerId="navigation-drawer" title="Benjamin Palko" {pages} route={page.route} />

View file

@ -1,44 +0,0 @@
import { logger } from '$lib/server/logger';
import { error } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
interface Data {
about: {
name: string;
bio: string;
titles: string[];
photo: {
url: string;
};
activities: { title: string; description: string }[];
};
}
export const load: PageServerLoad = async ({ locals }): Promise<Data | undefined> => {
const { strapi } = locals;
try {
const { data: about } = await strapi.About();
return {
about: {
name: about.Name,
bio: about.Bio,
titles: about.Titles.map((title: { value: string }) => title.value),
photo: {
url: about.Photo.url
},
activities: about.Activities.map((item: { Title: string; Description: string }) => {
return { title: item.Title, description: item.Description };
})
}
} satisfies Data;
} catch (err) {
if (err instanceof Error) {
logger.error('Uh-oh!', err);
if (err instanceof Error) {
error(500, err);
}
}
}
};

View file

@ -1,35 +1,24 @@
<script lang="ts">
import Hero from '$lib/components/Hero.svelte';
import { Braces } from 'lucide-svelte';
import type { PageProps } from './$types';
let { data }: PageProps = $props();
let about = $derived(data.about!);
type ActivityItem = Exclude<typeof about.activities, undefined>[number];
import { activities, description, name, titles } from '$lib/constants/about';
</script>
{#snippet Activity(item: ActivityItem)}
<div class="flex flex-col gap-4 lg:flex-row">
<Braces size={48} class="text-primary" />
<div class="flex flex-col">
<h3 class="text-xl">{item.title}</h3>
<p class="max-w-2xl">
{item.description}
</p>
</div>
</div>
{/snippet}
<div class="grid grid-cols-1 gap-8 px-6 md:grid-cols-2 md:px-12">
<div class="col-span-full lg:py-36">
<Hero photo={about.photo.url} titles={about.titles} name={about.name} description={about.bio} />
<Hero photo="/me.webp" {titles} {name} {description} />
</div>
<div class="col-span-full">
<h2 class="border-primary w-fit border-b text-2xl font-light">What I Do</h2>
</div>
{#each about.activities as activity (activity.title)}
{@render Activity(activity)}
{#each activities as item (item.title)}
<div class="flex flex-col gap-4 lg:flex-row">
<item.icon size={48} class="text-primary" />
<div class="flex flex-col">
<h3 class="text-xl">{item.title}</h3>
<p class="max-w-2xl">
{item.description}
</p>
</div>
</div>
{/each}
</div>