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">
import Banner2 from "$lib/banner2.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 type { PageProps } from "./$types";
// let {
// entries,
// }: {
// entries: GalleryEntry[];
// } = $props();
let entries = posts.map(mapEntries);
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
function leftpad(n: number): String {
@@ -39,5 +42,5 @@
<p>Development log entries in reverse chronological order (newest to oldest).</p>
<Gallery entries={data.entries} reverseTextOrder />
<Gallery {entries} reverseTextOrder />
</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 }) {
const post = await import(`../../${params.year}/${params.date}.md`);
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 title: string = postValues?.title ?? "";
const date: string = postValues?.date ?? "";

View File

@@ -5,143 +5,217 @@ export interface DevlogPost {
description: string;
};
export const posts = new Map<string, DevlogPost>([
["2025/1207", {
title: "Playing Games",
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.",
}],
["2025/1022", {
title: "Growing Pains",
date: "2025-10-22",
bannerAlt: "Close-up of Laura blinking",
description: "Trying to make Laura more lively through animation.",
}],
["2025/1011", {
title: "She's Here",
date: "2025-10-11",
bannerAlt: "Laura idle posing",
description: "I finally finished Laura, again!",
}],
["2025/0816", {
title: "Freeing the Past",
date: "2025-08-16",
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", {
title: "Remeshing and Recolouring",
date: "2025-07-13",
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/0523", {
title: "Reboot",
date: "2025-05-23",
bannerAlt: "Untextured Laura in a new purple level looking at two cubes",
description: "Starting all over again to do things better than last time because it's easier than trying to fix the existing systems.",
}],
["2025/0427", {
title: "The Making of a Protagonist, Part IV",
date: "2025-04-27",
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", {
title: "Refactoring",
date: "2025-03-16",
bannerAlt: "Laura t-posing in front of a smiling water tower",
description: "Introducing: Laura! Also: I want to do better than this!",
}],
["2025/0203", {
title: "The Making of a Protagonist, Part III",
date: "2025-02-03",
bannerAlt: "Three t-posing untextured Lauras",
description: "I gave Laura an animatable rig and started making her more expressive.",
}],
["2024/1222", {
title: "The Making of a Protagonist, Part II",
date: "2024-12-22",
bannerAlt: "Laura a-posing and wearing green and brown clothes",
description: "Introducing Laura's looks and my next plans for her.",
}],
["2024/1127", {
title: "The Making of a Protagonist, Part I",
date: "2024-11-27",
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/1103", {
title: "Visual Update",
date: "2024-11-03",
bannerAlt: "Two N5 Blaster side-to-side",
description: "How I simplified Node references in my code, and showing off some new weapons and visual effects too.",
}],
["2024/1012", {
title: "Returnal Update",
date: "2024-10-12",
bannerAlt: "Protagonist aiming at two monkeys",
description: "Overhauling signalling, aiming, and weapon icons!",
}],
["2024/0713", {
title: "WHERE HAVE I BEEN?? Update",
date: "2024-07-13",
bannerAlt: "Protagonist staring longingly into the distance, pointing the N5 Blaster thereto",
description: "Why there's been so little progress on the game lately.",
}],
["2024/0401", {
title: "Behind-The-Scenes Update",
date: "2024-04-01",
bannerAlt: "N5 Blaster with its lights turned off",
description: "Mostly refactoring code to make everything cleaner, but also showing off the new Venom blaster.",
}],
["2024/0324", {
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!",
}],
["2024/0323", {
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.",
}],
["2024/0312", {
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.",
}],
["2024/0210", {
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!",
}],
["2023/12", {
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.",
}],
["2023/11", {
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.",
}],
["2023/10", {
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.",
}],
["2023/09", {
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.",
}],
])
export interface DevlogPostLink {
key: string;
post: DevlogPost;
}
export const posts: DevlogPostLink[] = [
{
key: "2025/1207",
post: {
title: "Playing Games",
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.",
}
},
{
key: "2025/1022",
post: {
title: "Growing Pains",
date: "2025-10-22",
bannerAlt: "Close-up of Laura blinking",
description: "Trying to make Laura more lively through animation.",
}
},
{
key: "2025/1011",
post: {
title: "She's Here",
date: "2025-10-11",
bannerAlt: "Laura idle posing",
description: "I finally finished Laura, again!",
}
},
{
key: "2025/0816",
post: {
title: "Freeing the Past",
date: "2025-08-16",
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!",
}
},
{
key: "2025/0713",
post: {
title: "Remeshing and Recolouring",
date: "2025-07-13",
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!",
}
},
{
key: "2025/0523",
post: {
title: "Reboot",
date: "2025-05-23",
bannerAlt: "Untextured Laura in a new purple level looking at two cubes",
description: "Starting all over again to do things better than last time because it's easier than trying to fix the existing systems.",
}
},
{
key: "2025/0427",
post: {
title: "The Making of a Protagonist, Part IV",
date: "2025-04-27",
bannerAlt: "Sketches of Laura's new clothes",
description: "Starting to model a new Laura that's much more interesting than the old one.",
}
},
{
key: "2025/0316",
post: {
title: "Refactoring",
date: "2025-03-16",
bannerAlt: "Laura t-posing in front of a smiling water tower",
description: "Introducing: Laura! Also: I want to do better than this!",
}
},
{
key: "2025/0203",
post: {
title: "The Making of a Protagonist, Part III",
date: "2025-02-03",
bannerAlt: "Three t-posing untextured Lauras",
description: "I gave Laura an animatable rig and started making her more expressive.",
}
},
{
key: "2024/1222",
post: {
title: "The Making of a Protagonist, Part II",
date: "2024-12-22",
bannerAlt: "Laura a-posing and wearing green and brown clothes",
description: "Introducing Laura's looks and my next plans for her.",
}
},
{
key: "2024/1127",
post: {
title: "The Making of a Protagonist, Part I",
date: "2024-11-27",
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.",
}
},
{
key: "2024/1103",
post: {
title: "Visual Update",
date: "2024-11-03",
bannerAlt: "Two N5 Blaster side-to-side",
description: "How I simplified Node references in my code, and showing off some new weapons and visual effects too.",
}
},
{
key: "2024/1012",
post: {
title: "Returnal Update",
date: "2024-10-12",
bannerAlt: "Protagonist aiming at two monkeys",
description: "Overhauling signalling, aiming, and weapon icons!",
}
},
{
key: "2024/0713",
post: {
title: "WHERE HAVE I BEEN?? Update",
date: "2024-07-13",
bannerAlt: "Protagonist staring longingly into the distance, pointing the N5 Blaster thereto",
description: "Why there's been so little progress on the game lately.",
}
},
{
key: "2024/0401",
post: {
title: "Behind-The-Scenes Update",
date: "2024-04-01",
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.",
}
},
]