From 50f2e259e8477bfad38071d6111365a47ace6f33 Mon Sep 17 00:00:00 2001 From: denizk0461 Date: Fri, 5 Dec 2025 18:24:36 +0000 Subject: [PATCH] devlog post metadata is now fetched centrally from posts.ts --- .../projects/projectn5/devlog/+page.svelte | 58 ++----- .../projects/projectn5/devlog/[slug]/+page.ts | 14 +- src/routes/projects/projectn5/devlog/posts.ts | 141 ++++++++++++++++++ 3 files changed, 163 insertions(+), 50 deletions(-) create mode 100644 src/routes/projects/projectn5/devlog/posts.ts diff --git a/src/routes/projects/projectn5/devlog/+page.svelte b/src/routes/projects/projectn5/devlog/+page.svelte index dd5163e..2706de8 100644 --- a/src/routes/projects/projectn5/devlog/+page.svelte +++ b/src/routes/projects/projectn5/devlog/+page.svelte @@ -1,34 +1,8 @@ @@ -57,32 +39,20 @@

2023 progress updates summarise an entire month's work, respectively. Progress updates thereafter denote noteworthy developments in a more collected format.

- {#each posts as post, index} + {#each posts.values() as post, index} {@render devlogPost({post, index})} {/each}
-{#snippet liveUpdate({entry}: {entry: DevlogLiveEntry})} -
-

{entry.timestamp}

-

{entry.text}

-
-{/snippet} - {#snippet devlogPost({post, index}: {post: DevlogPost, index: number})}
- +
- Preview image for devlog {post.title} - + Preview image for devlog {post.title}
- {#if post.subtitle} - - {:else} - - {/if} +

{post.title}

diff --git a/src/routes/projects/projectn5/devlog/[slug]/+page.ts b/src/routes/projects/projectn5/devlog/[slug]/+page.ts index 3b0351b..166b90b 100644 --- a/src/routes/projects/projectn5/devlog/[slug]/+page.ts +++ b/src/routes/projects/projectn5/devlog/[slug]/+page.ts @@ -1,12 +1,14 @@ +import { posts, type DevlogPost } from '../posts'; + export async function load({ params }) { const post = await import(`../${params.slug}.md`); - const { - title, - date, - tag, - bannerAlt, - } = post.metadata; + + const tag: string = params.slug; + const postValues = posts.get(tag); const content = post.default; + const title = postValues?.title; + const date = postValues?.date; + const bannerAlt = postValues?.bannerAlt; return { content, diff --git a/src/routes/projects/projectn5/devlog/posts.ts b/src/routes/projects/projectn5/devlog/posts.ts new file mode 100644 index 0000000..bd8dbe6 --- /dev/null +++ b/src/routes/projects/projectn5/devlog/posts.ts @@ -0,0 +1,141 @@ +export interface DevlogPost { + title: string; + date: string; + id: string; + bannerAlt: string; +}; + +export const posts = new Map([ + ["20251022", { + title: "Growing Pains", + date: "2025-10-22", + id: "20251022", + bannerAlt: "Close-up of Laura blinking", + }], + ["20251011", { + title: "She's Here", + date: "2025-10-11", + id: "20251011", + bannerAlt: "Laura idle posing", + }], + ["20250816", { + title: "Freeing the Past", + date: "2025-08-16", + id: "20250816", + bannerAlt: "Bottom-up view at Laura v1 in front of a blue sky", + }], + ["20250713", { + title: "Remeshing and Recolouring", + date: "2025-07-13", + id: "20250713", + bannerAlt: "Close-up of Laura at face height", + }], + ["20250523", { + title: "Reboot", + date: "2025-05-23", + id: "20250523", + bannerAlt: "Untextured Laura in a new purple level looking at two cubes", + }], + ["20250427", { + title: "The Making of a Protagonist, Part IV", + date: "2025-04-27", + id: "20250427", + bannerAlt: "Sketches of Laura's new clothes", + }], + ["20250316", { + title: "Refactoring", + date: "2025-03-16", + id: "20250316", + bannerAlt: "Laura t-posing in front of a smiling water tower", + }], + ["20250203", { + title: "The Making of a Protagonist, Part III", + date: "2025-02-03", + id: "20250203", + bannerAlt: "Three t-posing untextured Lauras", + }], + ["20241222", { + title: "The Making of a Protagonist, Part II", + date: "2024-12-22", + id: "20241222", + bannerAlt: "Laura a-posing and wearing green and brown clothes", + }], + ["20241127", { + title: "The Making of a Protagonist, Part I", + date: "2024-11-27", + id: "20241127", + bannerAlt: "Multiple iterations of untextured hand 3D models", + }], + ["20241103", { + title: "Visual Update", + date: "2024-11-03", + id: "20241103", + bannerAlt: "Two N5 Blaster side-to-side", + }], + ["20241012", { + title: "Returnal Update", + date: "2024-10-12", + id: "20241012", + bannerAlt: "Protagonist aiming at two monkeys", + }], + ["20240713", { + title: "WHERE HAVE I BEEN?? Update", + date: "2024-07-13", + id: "20240713", + bannerAlt: "Protagonist staring longingly into the distance, pointing the N5 Blaster thereto", + }], + ["20240401", { + title: "Behind-The-Scenes Update", + date: "2024-04-01", + id: "20240401", + bannerAlt: "N5 Blaster with its lights turned off", + }], + ["20240324", { + title: "Arena Update", + date: "2024-03-24", + id: "20240324", + bannerAlt: "Protagonist being swamped by many monkey enemies", + }], + ["20240323", { + title: "Progress Update #7", + date: "2024-03-23", + id: "20240323", + bannerAlt: "A red enemy being blown up by an incoming rocket", + }], + ["20240312", { + title: "Progress Update #6", + date: "2024-03-12", + id: "20240312", + bannerAlt: "Protagonist pointing the N5 Blaster into the sky", + }], + ["20240210", { + title: "Progress Update #5", + date: "2024-02-10", + id: "20240210", + bannerAlt: "Panorama of the environment", + }], + ["202312", { + title: "Progress Update #4", + date: "2023-12", + id: "202312", + bannerAlt: "White protagonist holding the N5 Blaster", + }], + ["202311", { + title: "Progress Update #3", + date: "2023-11", + id: "202311", + bannerAlt: "A side view of the N5 Blaster", + }], + ["202310", { + title: "Progress Update #2", + date: "2023-10", + id: "202310", + bannerAlt: "Red protagonist lying on the floor, holding a purple blaster", + }], + ["202309", { + title: "Progress Update #1", + date: "2023-09", + id: "202309", + bannerAlt: "Ratchet from Ratchet: Gladiator and Sans from Undertale t-posing", + }], +])