--- import Layout from "../layouts/Layout.astro"; import ProjectListItem from "../components/ProjectListItem.astro"; import TimeSince from "../components/TimeSince.astro"; import { Icon } from "astro-icon/components"; interface ProjectMetadata { title: string; description: string; date: string; slug: string; hidden: boolean; image?: string; tags?: string[]; } interface AstroModule { metadata?: ProjectMetadata; } function parseDate(dateStr: string): Date { // formats like "February 2024", "January - June 2024", "Q1 2023", etc const lower = dateStr.toLowerCase(); if (lower.includes("q1")) return new Date("2023-01-01"); if (lower.includes("q2")) return new Date("2023-04-01"); if (lower.includes("q3")) return new Date("2023-07-01"); if (lower.includes("q4")) return new Date("2023-10-01"); const months: Record = { january: 0, february: 1, march: 2, april: 3, may: 4, june: 5, july: 6, august: 7, september: 8, october: 9, november: 10, december: 11, }; // month and year for (const [monthName, monthIndex] of Object.entries(months)) { if (lower.includes(monthName)) { const yearMatch = dateStr.match(/\b(20\d{2})\b/); if (yearMatch) { return new Date(parseInt(yearMatch[1]), monthIndex, 1); } } } // fallback: try to extract any year const yearMatch = dateStr.match(/\b(20\d{2})\b/); if (yearMatch) { return new Date(parseInt(yearMatch[1]), 0, 1); } return new Date(0); } const isDevMode = import.meta.env.PUBLIC_DEV === "1"; const projects: ProjectMetadata[] = Object.values( import.meta.glob("./projects/*.astro", { eager: true }) ) .map((module) => module.metadata) .filter((metadata): metadata is ProjectMetadata => metadata !== undefined) .filter((project) => !project.hidden || isDevMode) .sort((a, b) => parseDate(b.date).getTime() - parseDate(a.date).getTime()); const allTags = new Set(); projects.forEach((project) => { project.tags?.forEach((tag) => allTags.add(tag)); }); const sortedTags = Array.from(allTags).sort((a, b) => a.localeCompare(b)); ---

ABOUT

hex248 / 04oliverbryan@gmail.com
  • Name: Oliver Bryan
  • Role: Software Developer (Student)
  • Experience: 7 years, 1 year in industry as a Junior Software Developer
  • Skills: Web Development, Game Development, Python, JavaScript, TypeScript
  • Hobbies: Music, Travel, Badminton, Photography
  • Age:

PROJECTS

{ sortedTags.map((tag) => ( {tag} )) }
{ projects.map((project) => ( )) }