moved project n5 devlog data over from Map to custom DevlogPostLink data type

This commit is contained in:
2026-01-31 16:09:23 +01:00
parent 17abe0182d
commit 06b4d9c318
4 changed files with 229 additions and 172 deletions

View File

@@ -1,21 +0,0 @@
import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";
import { posts, type DevlogPost } from "./devlog/posts";
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = ({ params }) => {
let a = posts.entries().map(mapEntries).toArray();
return {
entries: a,
};
};
function mapEntries(m: [String, DevlogPost], index: number): GalleryEntry {
return {
title: `${m[1].title}`,
subtitle: `#${posts.size - index} // ${m[1].date}`,
img: `/projects/projectn5/devlog/${m[0]}/preview.webp`,
link: `/projects/projectn5/devlog/${m[0]}/`,
imgAlt: `Preview image for ${m[1].title}`,
};
}

View File

@@ -1,17 +1,20 @@
<script lang="ts"> <script lang="ts">
import Banner2 from "$lib/banner2.svelte"; import Banner2 from "$lib/banner2.svelte";
import Content from "$lib/viewport/content.svelte"; import Content from "$lib/viewport/content.svelte";
import { posts, type DevlogPost } from "./devlog/posts"; import { posts, type DevlogPost, type DevlogPostLink } from "./devlog/posts";
import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte"; import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";
import type { PageProps } from "./$types";
// let { let entries = posts.map(mapEntries);
// entries,
// }: {
// entries: GalleryEntry[];
// } = $props();
let { data }: PageProps = $props(); function mapEntries(entry: DevlogPostLink, index: number): GalleryEntry {
return {
title: `${entry.post.title}`,
subtitle: `#${posts.length - index} // ${entry.post.date}`,
img: `/projects/projectn5/devlog/${entry.key}/preview.webp`,
link: `/projects/projectn5/devlog/${entry.key}/`,
imgAlt: `Preview image for ${entry.post.title}`,
};
}
// Leftpads a single-digit number to two digits // Leftpads a single-digit number to two digits
function leftpad(n: number): String { function leftpad(n: number): String {
@@ -39,5 +42,5 @@
<p>Development log entries in reverse chronological order (newest to oldest).</p> <p>Development log entries in reverse chronological order (newest to oldest).</p>
<Gallery entries={data.entries} reverseTextOrder /> <Gallery {entries} reverseTextOrder />
</Content> </Content>

View File

@@ -1,10 +1,11 @@
import { posts, type DevlogPost } from '../../posts'; import { posts, type DevlogPost, type DevlogPostLink } from '../../posts';
export async function load({ params }) { export async function load({ params }) {
const post = await import(`../../${params.year}/${params.date}.md`); const post = await import(`../../${params.year}/${params.date}.md`);
const tag: string = `${params.year}/${params.date}`; const tag: string = `${params.year}/${params.date}`;
const postValues = posts.get(tag); // const postValues = posts.get(tag);
const postValues = posts.find((v: DevlogPostLink) => v.key == tag)?.post;
const content = post.default; const content = post.default;
const title: string = postValues?.title ?? ""; const title: string = postValues?.title ?? "";
const date: string = postValues?.date ?? ""; const date: string = postValues?.date ?? "";

View File

@@ -5,143 +5,217 @@ export interface DevlogPost {
description: string; description: string;
}; };
export const posts = new Map<string, DevlogPost>([ export interface DevlogPostLink {
["2025/1207", { key: string;
title: "Playing Games", post: DevlogPost;
date: "2025-12-07", }
bannerAlt: "An establishing shot of tall towers in front of Laura",
description: "Implementing gameplay elements such as missions and minigames and cheats too.", export const posts: DevlogPostLink[] = [
}], {
["2025/1022", { key: "2025/1207",
title: "Growing Pains", post: {
date: "2025-10-22", title: "Playing Games",
bannerAlt: "Close-up of Laura blinking", date: "2025-12-07",
description: "Trying to make Laura more lively through animation.", bannerAlt: "An establishing shot of tall towers in front of Laura",
}], description: "Implementing gameplay elements such as missions and minigames and cheats too.",
["2025/1011", { }
title: "She's Here", },
date: "2025-10-11", {
bannerAlt: "Laura idle posing", key: "2025/1022",
description: "I finally finished Laura, again!", post: {
}], title: "Growing Pains",
["2025/0816", { date: "2025-10-22",
title: "Freeing the Past", bannerAlt: "Close-up of Laura blinking",
date: "2025-08-16", description: "Trying to make Laura more lively through animation.",
bannerAlt: "Bottom-up view at Laura v1 in front of a blue sky", }
description: "Old builds of Project N5 now available to play and download!", },
}], {
["2025/0713", { key: "2025/1011",
title: "Remeshing and Recolouring", post: {
date: "2025-07-13", title: "She's Here",
bannerAlt: "Close-up of Laura at face height", date: "2025-10-11",
description: "Modelling lots of detail into Laura and learning to sway to and fro like little insects!", bannerAlt: "Laura idle posing",
}], description: "I finally finished Laura, again!",
["2025/0523", { }
title: "Reboot", },
date: "2025-05-23", {
bannerAlt: "Untextured Laura in a new purple level looking at two cubes", key: "2025/0816",
description: "Starting all over again to do things better than last time because it's easier than trying to fix the existing systems.", post: {
}], title: "Freeing the Past",
["2025/0427", { date: "2025-08-16",
title: "The Making of a Protagonist, Part IV", bannerAlt: "Bottom-up view at Laura v1 in front of a blue sky",
date: "2025-04-27", description: "Old builds of Project N5 now available to play and download!",
bannerAlt: "Sketches of Laura's new clothes", }
description: "Starting to model a new Laura that's much more interesting than the old one.", },
}], {
["2025/0316", { key: "2025/0713",
title: "Refactoring", post: {
date: "2025-03-16", title: "Remeshing and Recolouring",
bannerAlt: "Laura t-posing in front of a smiling water tower", date: "2025-07-13",
description: "Introducing: Laura! Also: I want to do better than this!", bannerAlt: "Close-up of Laura at face height",
}], description: "Modelling lots of detail into Laura and learning to sway to and fro like little insects!",
["2025/0203", { }
title: "The Making of a Protagonist, Part III", },
date: "2025-02-03", {
bannerAlt: "Three t-posing untextured Lauras", key: "2025/0523",
description: "I gave Laura an animatable rig and started making her more expressive.", post: {
}], title: "Reboot",
["2024/1222", { date: "2025-05-23",
title: "The Making of a Protagonist, Part II", bannerAlt: "Untextured Laura in a new purple level looking at two cubes",
date: "2024-12-22", description: "Starting all over again to do things better than last time because it's easier than trying to fix the existing systems.",
bannerAlt: "Laura a-posing and wearing green and brown clothes", }
description: "Introducing Laura's looks and my next plans for her.", },
}], {
["2024/1127", { key: "2025/0427",
title: "The Making of a Protagonist, Part I", post: {
date: "2024-11-27", title: "The Making of a Protagonist, Part IV",
bannerAlt: "Multiple iterations of untextured hand 3D models", date: "2025-04-27",
description: "First steps towards creating the game's protagonist Laura, and moving away from the original game idea.", bannerAlt: "Sketches of Laura's new clothes",
}], description: "Starting to model a new Laura that's much more interesting than the old one.",
["2024/1103", { }
title: "Visual Update", },
date: "2024-11-03", {
bannerAlt: "Two N5 Blaster side-to-side", key: "2025/0316",
description: "How I simplified Node references in my code, and showing off some new weapons and visual effects too.", post: {
}], title: "Refactoring",
["2024/1012", { date: "2025-03-16",
title: "Returnal Update", bannerAlt: "Laura t-posing in front of a smiling water tower",
date: "2024-10-12", description: "Introducing: Laura! Also: I want to do better than this!",
bannerAlt: "Protagonist aiming at two monkeys", }
description: "Overhauling signalling, aiming, and weapon icons!", },
}], {
["2024/0713", { key: "2025/0203",
title: "WHERE HAVE I BEEN?? Update", post: {
date: "2024-07-13", title: "The Making of a Protagonist, Part III",
bannerAlt: "Protagonist staring longingly into the distance, pointing the N5 Blaster thereto", date: "2025-02-03",
description: "Why there's been so little progress on the game lately.", bannerAlt: "Three t-posing untextured Lauras",
}], description: "I gave Laura an animatable rig and started making her more expressive.",
["2024/0401", { }
title: "Behind-The-Scenes Update", },
date: "2024-04-01", {
bannerAlt: "N5 Blaster with its lights turned off", key: "2024/1222",
description: "Mostly refactoring code to make everything cleaner, but also showing off the new Venom blaster.", post: {
}], title: "The Making of a Protagonist, Part II",
["2024/0324", { date: "2024-12-22",
title: "Arena Update", bannerAlt: "Laura a-posing and wearing green and brown clothes",
date: "2024-03-24", description: "Introducing Laura's looks and my next plans for her.",
bannerAlt: "Protagonist being swamped by many monkey enemies", }
description: "In an 8-hour spurt of motivation, I created an entire arena system! And a monkey to fight!", },
}], {
["2024/0323", { key: "2024/1127",
title: "Progress Update #7", post: {
date: "2024-03-23", title: "The Making of a Protagonist, Part I",
bannerAlt: "A red enemy being blown up by an incoming rocket", date: "2024-11-27",
description: "Camera, weapons, and money all get some visual flair.", bannerAlt: "Multiple iterations of untextured hand 3D models",
}], description: "First steps towards creating the game's protagonist Laura, and moving away from the original game idea.",
["2024/0312", { }
title: "Progress Update #6", },
date: "2024-03-12", {
bannerAlt: "Protagonist pointing the N5 Blaster into the sky", key: "2024/1103",
description: "Lots of planning for the future, sketches, and TODO organisation.", post: {
}], title: "Visual Update",
["2024/0210", { date: "2024-11-03",
title: "Progress Update #5", bannerAlt: "Two N5 Blaster side-to-side",
date: "2024-02-10", description: "How I simplified Node references in my code, and showing off some new weapons and visual effects too.",
bannerAlt: "Panorama of the environment", }
description: "Yet another new protagonist gains new abilities and faces their first foe!", },
}], {
["2023/12", { key: "2024/1012",
title: "Progress Update #4", post: {
date: "2023-12", title: "Returnal Update",
bannerAlt: "White protagonist holding the N5 Blaster", date: "2024-10-12",
description: "Trying to design a game logo and implementing a new protagonist.", bannerAlt: "Protagonist aiming at two monkeys",
}], description: "Overhauling signalling, aiming, and weapon icons!",
["2023/11", { }
title: "Progress Update #3", },
date: "2023-11", {
bannerAlt: "A side view of the N5 Blaster", key: "2024/0713",
description: "First time modelling weapons yields some shiny gadgets; also, an inventory system.", post: {
}], title: "WHERE HAVE I BEEN?? Update",
["2023/10", { date: "2024-07-13",
title: "Progress Update #2", bannerAlt: "Protagonist staring longingly into the distance, pointing the N5 Blaster thereto",
date: "2023-10", description: "Why there's been so little progress on the game lately.",
bannerAlt: "Red protagonist lying on the floor, holding a purple blaster", }
description: "I implemented weapons, worked on the character movement, and created the first menus.", },
}], {
["2023/09", { key: "2024/0401",
title: "Progress Update #1", post: {
date: "2023-09", title: "Behind-The-Scenes Update",
bannerAlt: "Ratchet from Ratchet: Gladiator and Sans from Undertale t-posing", date: "2024-04-01",
description: "My first steps towards Godot game development and Blender character creation.", bannerAlt: "N5 Blaster with its lights turned off",
}], description: "Mostly refactoring code to make everything cleaner, but also showing off the new Venom blaster.",
]) }
},
{
key: "2024/0324",
post: {
title: "Arena Update",
date: "2024-03-24",
bannerAlt: "Protagonist being swamped by many monkey enemies",
description: "In an 8-hour spurt of motivation, I created an entire arena system! And a monkey to fight!",
}
},
{
key: "2024/0323",
post: {
title: "Progress Update #7",
date: "2024-03-23",
bannerAlt: "A red enemy being blown up by an incoming rocket",
description: "Camera, weapons, and money all get some visual flair.",
}
},
{
key: "2024/0312",
post: {
title: "Progress Update #6",
date: "2024-03-12",
bannerAlt: "Protagonist pointing the N5 Blaster into the sky",
description: "Lots of planning for the future, sketches, and TODO organisation.",
}
},
{
key: "2024/0210",
post: {
title: "Progress Update #5",
date: "2024-02-10",
bannerAlt: "Panorama of the environment",
description: "Yet another new protagonist gains new abilities and faces their first foe!",
}
},
{
key: "2023/12",
post: {
title: "Progress Update #4",
date: "2023-12",
bannerAlt: "White protagonist holding the N5 Blaster",
description: "Trying to design a game logo and implementing a new protagonist.",
}
},
{
key: "2023/11",
post: {
title: "Progress Update #3",
date: "2023-11",
bannerAlt: "A side view of the N5 Blaster",
description: "First time modelling weapons yields some shiny gadgets; also, an inventory system.",
}
},
{
key: "2023/10",
post: {
title: "Progress Update #2",
date: "2023-10",
bannerAlt: "Red protagonist lying on the floor, holding a purple blaster",
description: "I implemented weapons, worked on the character movement, and created the first menus.",
}
},
{
key: "2023/09",
post: {
title: "Progress Update #1",
date: "2023-09",
bannerAlt: "Ratchet from Ratchet: Gladiator and Sans from Undertale t-posing",
description: "My first steps towards Godot game development and Blender character creation.",
}
},
]