From 38ce5f3554d96e5c9193a70bfe509d9ef4197cb4 Mon Sep 17 00:00:00 2001 From: voidarc Date: Tue, 10 Nov 2026 13:52:23 +0000 Subject: [PATCH] added commit display --- src/routes/+page.server.ts | 7 ++- src/routes/+page.svelte | 7 +++ src/routes/Commits.svelte | 108 +++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 src/routes/Commits.svelte diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 0653ac5..9921b74 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -2,7 +2,9 @@ import type { PageServerLoad } from './$types'; import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin'; import { getLatestBook } from '#lib/server/komga'; import { getContentItems } from '#lib/server/content'; +import { getLatestCommits } from '#lib/server/gitea'; import type { ContentItem } from '#lib/server/content'; +import type { GitCommit } from '#lib/server/gitea'; import { JELLYFIN_PLAYLIST_ID, JELLYFIN_LIBRARY_ID, @@ -17,19 +19,22 @@ export const load: PageServerLoad = () => { const latestBook = getLatestBook(globalThis.fetch, KOMGA_LIBRARY_ID); const contentItems: ContentItem = getContentItems(globalThis.fetch, CHANNEL_ID, BLOG_URL); + const latestCommits: GitCommit = getLatestCommits(globalThis.fetch, 10); latestSong.catch(() => {}); latestSeries.catch(() => {}); latestBook.catch(() => {}); contentItems.catch(() => {}); + latestCommits.catch(() => {}); return { streamed: { latestSong, latestSeries, latestBook, - contentItems + contentItems, + latestCommits } }; }; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 53fde8c..5839937 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -3,6 +3,7 @@ import { SiGit, SiHugo, SiYoutube } from '@icons-pack/svelte-simple-icons'; import Content from './Content.svelte'; + import Commits from './Commits.svelte'; let { data }: { data: PageData } = $props(); import voidarcIcon from '../voidarc-hollow.svg?raw'; @@ -187,6 +188,12 @@ + {#await data.streamed.latestCommits} +

loading commits...

+ {:then commits} + {console.log(commits)} + + {/await} diff --git a/src/routes/Commits.svelte b/src/routes/Commits.svelte new file mode 100644 index 0000000..99c0f44 --- /dev/null +++ b/src/routes/Commits.svelte @@ -0,0 +1,108 @@ + + +
+ + + + {#each nodePositions as node, index} + {#if nodePositions[index + 1]} + + {/if} + {/each} + + + {#each nodePositions as node} + + {/each} + + + +
+ {#each items as item, index (item.hash)} +
+ +
+ + + +
+ {/each} +
+