diff --git a/site/src/components/Job.astro b/site/src/components/Job.astro index adfa29f..4f61857 100644 --- a/site/src/components/Job.astro +++ b/site/src/components/Job.astro @@ -12,6 +12,13 @@ interface Props { const { data: { organization, role, start, end, image, description }, } = Astro.props; + +function monthYear(s: string): string { + return new Date(`${s}-01`).toLocaleString("en-US", { + month: "short", + year: "numeric", + }); +} ---
@@ -21,10 +28,10 @@ const {

{organization}

{role}

{start === end ? ( -

{start}

+

{monthYear(start)}

) : (

- {start} – {end ?? "Present"} + {monthYear(start)} – {end ? monthYear(end) : "Present"}

)} diff --git a/site/src/content.config.ts b/site/src/content.config.ts index 1bb6b65..67e837f 100644 --- a/site/src/content.config.ts +++ b/site/src/content.config.ts @@ -42,6 +42,7 @@ const education = defineCollection({ start: z.string().nonempty(), end: z.string().nonempty().optional(), image: image(), + kind: z.enum(["degree", "certification"]), description: z.string(), }), }); diff --git a/site/src/data/work/education.yml b/site/src/data/work/education.yml index e2e4fa8..d2aad1f 100644 --- a/site/src/data/work/education.yml +++ b/site/src/data/work/education.yml @@ -1,4 +1,5 @@ - id: byu-bs-cs + kind: "degree" organization: Brigham Young University role: B.S. Computer Science start: "Sep 2020" @@ -8,6 +9,7 @@ Cum Laude - 3.96 GPA - id: aws-cloudquest-cloud-practitioner + kind: "certification" organization: Amazon Web Services role: CloudQuest Cloud Practitioner start: "Sep 2025" @@ -16,6 +18,7 @@ description: > - id: rock-jvm-advanced-scala-fp + kind: "certification" organization: Rock the JVM role: "Advanced Scala 3 & Functional Programming" start: "Sep 2023" diff --git a/site/src/data/work/professional.yml b/site/src/data/work/professional.yml index fbdd8e5..620bff7 100644 --- a/site/src/data/work/professional.yml +++ b/site/src/data/work/professional.yml @@ -1,7 +1,7 @@ - id: fidelity-associate-swe organization: Fidelity Investments role: Associate Software Engineer - start: "Jun 2025" + start: "2025-06" image: ./img/fidelity.jpg description: > I currently work as a software engineer for Fidelity Brokerage's Digital @@ -16,8 +16,8 @@ - id: opiniion-integrations-eng organization: Opiniion, Inc. role: Integrations Engineer - start: "Aug 2024" - end: "Jun 2025" + start: "2024-08" + end: "2025-06" image: ./img/opiniion.jpg description: > Opiniion is a platform for property management companies to collect @@ -42,8 +42,8 @@ - id: fidelity-swe-intern organization: Fidelity Investments role: Software Engineer Intern - start: "Jun 2024" - end: "Aug 2024" + start: "2024-06" + end: "2024-08" image: ./img/fidelity.jpg description: > I interned at Fidelity in the summer of 2024 as a software engineer for @@ -60,8 +60,8 @@ - id: byu-ls-web-dev organization: BYU Learning Suite role: Web Developer - start: "May 2022" - end: "May 2024" + start: "2022-05" + end: "2024-05" image: ./img/ls.jpg description: > Learning Suite is a proprietary learning management system (LMS) built diff --git a/site/src/pages/work.astro b/site/src/pages/work.astro index 2e3b6e5..a502e4d 100644 --- a/site/src/pages/work.astro +++ b/site/src/pages/work.astro @@ -1,5 +1,5 @@ --- -import { getCollection } from "astro:content"; +import { type CollectionEntry, getCollection } from "astro:content"; import Job from "../components/Job.astro"; import Layout from "../layouts/Layout.astro"; @@ -8,9 +8,47 @@ const description = "A high-level overview of the problems I’ve worked on professionally or as a FOSS contributor. " + "Not exhaustive, just the work that’s interesting enough to explain in more detail."; -const professional = await getCollection("professional"); -const education = await getCollection("education"); -const foss = await getCollection("foss"); +function byRecency( + a: CollectionEntry<"professional" | "education" | "foss">, + b: CollectionEntry<"professional" | "education" | "foss">, +): number { + return ( + new Date(`${b.data.start}-01`).valueOf() - + new Date(`${a.data.start}-01`).valueOf() + ); +} + +function byKind( + a: CollectionEntry<"education">, + b: CollectionEntry<"education">, +): number { + switch (a.data.kind) { + case "degree": + switch (b.data.kind) { + case "degree": + return 0; + case "certification": + return -1; + default: + return 0; + } + case "certification": + switch (b.data.kind) { + case "degree": + return 1; + case "certification": + return 0; + default: + return 0; + } + } +} + +const professional = (await getCollection("professional")).sort(byRecency); +const education = (await getCollection("education")).sort( + (a, b) => byKind(a, b) || byRecency(a, b), +); +const foss = (await getCollection("foss")).sort(byRecency); ---