Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const education = defineCollection({
role: z.string(),
dateStart: z.coerce.date(),
dateEnd: z.union([z.coerce.date(), z.string()]),
// A formal degree, as opposed to a certificate or a course. The homepage
// shows only the three most recent entries, and the degree is the oldest
// one, so without this flag it fell off the end and the section listed
// three certificates and no degree.
degree: z.boolean().optional().default(false),
}),
})

Expand Down
4 changes: 2 additions & 2 deletions src/content/education/encode_club.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
place: "Encode.club Web3 Education Community"
role: "Solidity & Ethereum Blockchain Development"
dateStart: "08/01/2017"
dateEnd: "07/31/2022"
dateStart: "06/01/2022"
dateEnd: "12/31/2022"
---
1 change: 1 addition & 0 deletions src/content/education/hs_esslingen.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ place: "University of Applied Science"
role: "Bachelor of Engineering in Engineering Management"
dateStart: "03/01/2014"
dateEnd: "02/28/2017"
degree: true
---

GPA 3.5, Top 5 grad
7 changes: 6 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@ export function dateRange(startDate: Date, endDate?: Date | string): string {
const start = `${startMonth} ${startYear}`;
const end = endMonth ? `${endMonth} ${endYear}` : endYear;

return end ? `${start} - ${end}` : start;
if (!end) return start;
// An entry that starts and ends inside one month rendered as
// "May 2022 - May 2022", which reads as a broken template even where the
// dates are right. Print the month once instead.
if (start === end) return start;
return `${start} - ${end}`;
}
4 changes: 0 additions & 4 deletions src/pages/education/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ const education = await Promise.all(
))
}
</ul>
<!--
<ul class="animate flex flex-col gap-4">

</ul> -->
</div>
</Container>
</PageLayout>
30 changes: 17 additions & 13 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ const work = await Promise.all(
})
)

const alleducation = (await getCollection("education"))
.sort(
(a, b) =>
new Date(b.data.dateStart).valueOf() -
new Date(a.data.dateStart).valueOf()
)
.slice(0, SITE.NUM_EDUCATION_ON_HOMEPAGE)
const newestFirst = (a: { data: { dateStart: Date } }, b: { data: { dateStart: Date } }) =>
new Date(b.data.dateStart).valueOf() - new Date(a.data.dateStart).valueOf()

// Newest first would be the obvious order, but the degree is the oldest entry
// by six years, so the slice dropped it and the homepage listed three
// certificates and no degree. Degrees go first, then the rest by date.
const educationEntries = await getCollection("education")
const alleducation = [
...educationEntries.filter((entry) => entry.data.degree).sort(newestFirst),
...educationEntries.filter((entry) => !entry.data.degree).sort(newestFirst),
].slice(0, SITE.NUM_EDUCATION_ON_HOMEPAGE)

const education = await Promise.all(
alleducation.map(async (item) => {
Expand Down Expand Up @@ -70,13 +74,13 @@ const education = await Promise.all(
</p>
</section>

{/* No "See all projects" here. The grid below renders every entry in
APPS, so the link led nowhere new, and the same link appears again on
the Recent projects section further down. */}
<section class="animate space-y-6">
<div class="flex flex-wrap gap-y-2 items-center justify-between">
<h2 class="font-semibold text-xl text-black dark:text-white">
Apps I've built
</h2>
<Link href="/projects">See all projects →</Link>
</div>
<h2 class="font-semibold text-xl text-black dark:text-white">
Apps I've built
</h2>
<ul class="animate-stagger grid grid-cols-1 sm:grid-cols-2 gap-4">
{
APPS.map((app) => (
Expand Down