From db236538a0a07dfe113fc15a47cfe7b3bc44267b Mon Sep 17 00:00:00 2001 From: denizk0461 Date: Fri, 24 Apr 2026 20:33:30 +0200 Subject: [PATCH] added date of latest feed post to main page --- src/routes/+page.svelte | 105 +++++++++++++++++++++++----------------- src/routes/feed/feed.ts | 6 ++- 2 files changed, 66 insertions(+), 45 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 45fcc98..bdf069c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -6,14 +6,29 @@ import { posts as blogPosts } from "./blog/posts"; import IndieButton from "$lib/components/indie-button.svelte"; import { buttons } from "$lib/components/indie-button"; - import { onMount } from "svelte"; + import { getContext, onMount, setContext } from "svelte"; + import { getLatestFeedItem } from "./feed/feed"; let latestDevlogDate = devlogPosts[0].post.date; let latestBlogDate = blogPosts[0].post.date; + let latestFeedDate = $state("a"); let latestStatusContent = $state("fetching status..."); let latestStatusTimestamp = $state("?"); + async function getLatestFeedDate() { + await getLatestFeedItem( + ).then((response) => { + // remove time, only keep date. thanks again sweden + latestFeedDate = new Date( + response.metadata.posted + ).toLocaleString("sv-SE").substring( + 0, + response.metadata.posted.indexOf("T") + ); + }); + } + async function getLatestStatus() { await fetch(`https://back.natconf.dev/netstatus/latestStatus`, { method: "GET", @@ -31,49 +46,9 @@ } onMount(() => { + getLatestFeedDate(); getLatestStatus(); }) - - const galleryTopRow: GalleryRowEntry[] = [ - { - title: "Homesick – devlog", - description: `my active Godot game project about finding yourself in an unfamiliar future. latest update: ${latestDevlogDate}`, - img: "projects/projectn5/banner2.webp", - altText: "The protagonist Laura standing on a floating platform in the purple test level. Ziplines are all around her and the text 'When this text is spinning, the game is not paused' is frozen in the sky.", - link: "projects/projectn5", - }, - { - title: "Projects", - description: "[updated] an overview of all my projects!", - img: "projects/banner.webp", - altText: "An upside-down New 3DS XL lying open on a desk with a small USB-C breakout board attached to it, and a USB-C cable plugged in. The 3DS is glowing to indicate that it is charging.", - link: "projects", - }, - ]; - - const galleryBottomRow: GalleryRowEntry[] = [ - { - title: "Creative Feed", - description: `the small things I make find a home here.`, - img: "feed/banner.webp", - altText: "A blue screen with the text 'how do you do art ? 1. face your fears 2. become your heroes'. The 'art' looks to have been edited in. The music artist Porter Robinson is standing in the bottom right corner.", - link: "feed", - }, - { - title: "Blog", - description: `a place where I write about random things. latest post: ${latestBlogDate}`, - img: "blog/robert.webp", - altText: "View at a tram bridge rising and then curving to the left.", - link: "blog", - }, - { - title: "Files", - description: "find things I've put for download on my copyparty instance.", - img: "main/hypertext.webp", - altText: "Screenshot of Hypertext Unity level. Crates are strewn across the floor, Waluigi is flying in front of the camera, and text such as 'COME AND TRY OUR ALL-NEW BLENDER' and 'omg! it's the brandenbur ger tor!' is displayed.", - link: "https://files.natconf.dev/public/", - }, - ]; @@ -98,6 +73,8 @@

I listen to a lot of music. My favourite artists are acloudyskye, Jaron, Jane Remover, but you can find my current rotation here. I also enjoy dabbling around in cool FOSS tools like Godot, Blender, and Krita which I use under Fedora KDE. If you want to know more about me and this website, go here!

irl I am from 🇩🇪 Northern Germany and studying to become a secondary school teacher, but between you and me; I may end up doing something else :).

+ +

{latestFeedDate}

@@ -124,8 +101,48 @@
- - + latest update: ${latestDevlogDate}`, + img: "projects/projectn5/banner2.webp", + altText: "The protagonist Laura standing on a floating platform in the purple test level. Ziplines are all around her and the text 'When this text is spinning, the game is not paused' is frozen in the sky.", + link: "projects/projectn5", + }, + { + title: "Projects", + description: "[updated] an overview of all my projects!", + img: "projects/banner.webp", + altText: "An upside-down New 3DS XL lying open on a desk with a small USB-C breakout board attached to it, and a USB-C cable plugged in. The 3DS is glowing to indicate that it is charging.", + link: "projects", + }, + ]} /> + + latest post: ${latestFeedDate}`, + img: "feed/banner.webp", + altText: "A blue screen with the text 'how do you do art ? 1. face your fears 2. become your heroes'. The 'art' looks to have been edited in. The music artist Porter Robinson is standing in the bottom right corner.", + link: "feed", + }, + { + title: "Blog", + description: `a place where I write about random things. latest post: ${latestBlogDate}`, + img: "blog/robert.webp", + altText: "View at a tram bridge rising and then curving to the left.", + link: "blog", + }, + { + title: "Files", + description: "find things I've put for download on my copyparty instance.", + img: "main/hypertext.webp", + altText: "Screenshot of Hypertext Unity level. Crates are strewn across the floor, Waluigi is flying in front of the camera, and text such as 'COME AND TRY OUR ALL-NEW BLENDER' and 'omg! it's the brandenbur ger tor!' is displayed.", + link: "https://files.natconf.dev/public/", + }, + ]} />
diff --git a/src/routes/feed/feed.ts b/src/routes/feed/feed.ts index d0a2c49..6c99e5e 100644 --- a/src/routes/feed/feed.ts +++ b/src/routes/feed/feed.ts @@ -2,4 +2,8 @@ export let entries: string[] = [ "electronics/nintendo-repairs", "electronics/trans-phone", "drawings/lecturer-gender", -]; \ No newline at end of file +]; + +export function getLatestFeedItem(): Promise { + return import(`./${entries[0]}.md`); +} \ No newline at end of file