From 6ad73c98e226bb38d70da88a454b434605684bb3 Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 26 Mar 2026 16:46:30 -0400 Subject: [PATCH] refactor: break Timeline into composable components for reuse Split Timeline component into a generic wrapper and EducationItem component to support adding Experience and other timeline-based sections later. --- ...melineItem.svelte => EducationItem.svelte} | 71 +++++++++---------- src/components/svelte/Timeline.svelte | 43 ++--------- src/data/education.ts | 22 ++++++ src/pages/index.astro | 42 ++--------- 4 files changed, 65 insertions(+), 113 deletions(-) rename src/components/svelte/{TimelineItem.svelte => EducationItem.svelte} (78%) create mode 100644 src/data/education.ts diff --git a/src/components/svelte/TimelineItem.svelte b/src/components/svelte/EducationItem.svelte similarity index 78% rename from src/components/svelte/TimelineItem.svelte rename to src/components/svelte/EducationItem.svelte index 79ae957..fd924bd 100644 --- a/src/components/svelte/TimelineItem.svelte +++ b/src/components/svelte/EducationItem.svelte @@ -1,16 +1,10 @@ - - let { - school, - degree, - minor, - gpa, - location, - startYear, - startMonth, - endYear, - endMonth, - expected = false, - courses = [], - awards = [], - }: Props = $props() +
- {#each entries as entry} - - {/each} + {@render children()}
diff --git a/src/data/education.ts b/src/data/education.ts new file mode 100644 index 0000000..fa0df6d --- /dev/null +++ b/src/data/education.ts @@ -0,0 +1,22 @@ +import type { EducationEntry } from '@/components/svelte/EducationItem.svelte' + +export const education: EducationEntry[] = [ + { + school: 'University of Guelph', + degree: 'Bachelor of Computing', + minor: 'Mathematics', + gpa: '4.0', + location: 'Guelph, Canada', + startYear: 2019, + startMonth: 'Sept', + endYear: 2024, + endMonth: 'May', + expected: false, + courses: ['Data Structures', 'Algorithms', 'Software Engineering', 'Operating Systems', 'Databases', 'Computer Networks'], + awards: [ + { name: "Dean's List", description: 'In each full-time semester' }, + { name: 'Weiner Mathematical Scholarship', description: 'Highest mathematics average (1st year)' }, + { name: 'R.A Fisher Statistics Scholarship', description: 'Highest statistics average (2nd year)' }, + ], + }, +] diff --git a/src/pages/index.astro b/src/pages/index.astro index aabbf11..0ef2f23 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -15,44 +15,12 @@ import IconWrench from '~icons/lucide/wrench' import IconFolderCode from '~icons/lucide/folder-code' import IconPenLine from '~icons/lucide/pen-line' import Timeline from '../components/svelte/Timeline.svelte' -import type { TimelineEntry } from '../components/svelte/Timeline.svelte' +import EducationItem from '../components/svelte/EducationItem.svelte' +import { education } from '@/data/education' import ContactForm from '../components/svelte/ContactForm.svelte' import IconMail from '~icons/lucide/mail' const blog = await getRecentPosts(3) - -const education: TimelineEntry[] = [ - // { - // school: 'Georgia Tech', - // degree: 'Master\'s of Computer Science', - // location: 'Atlanta, Georgia', - // startYear: 2026, - // startMonth: 'Sept', - // expected: false, - // courses: [], - // awards: [ - - // ], - // }, - { - school: 'University of Guelph', - degree: 'Bachelor of Computing', - minor: 'Mathematics', - gpa: '4.0', - location: 'Guelph, Canada', - startYear: 2019, - startMonth: 'Sept', - endYear: 2024, - endMonth: 'May', - expected: false, - courses: ['Data Structures', 'Algorithms', 'Software Engineering', 'Operating Systems', 'Databases', 'Computer Networks'], - awards: [ - { name: 'Dean\'s List', description: 'In each full-time semester' }, - { name: 'Weiner Mathematical Scholarship', description: 'Highest mathematics average (1st year)' }, - { name: 'R.A Fisher Statistics Scholarship', description: 'Highest statistics average (2nd year)' }, - ], - }, -] const featuredProjects = await getFeaturedProjects() const currentUrl = Astro.url; const turnstileSitekey = import.meta.env.PUBLIC_TURNSTILE_SITEKEY @@ -203,7 +171,11 @@ const turnstileSitekey = import.meta.env.PUBLIC_TURNSTILE_SITEKEY

- + + {education.map(entry => ( + + ))} +