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