From d66ec730b51886d75ae362a6e6c9cae2e87e6008 Mon Sep 17 00:00:00 2001 From: Robert Brunhage Date: Thu, 5 Dec 2024 16:37:56 +0100 Subject: [PATCH] fix: upvotes and votes not correctly linked --- .github/workflows/update-votes.yml | 3 ++- src/pages/index.astro | 23 +++++++++++++++-------- src/utils/votes.ts | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-votes.yml b/.github/workflows/update-votes.yml index a0dffa0..df598aa 100644 --- a/.github/workflows/update-votes.yml +++ b/.github/workflows/update-votes.yml @@ -39,6 +39,7 @@ jobs: nodes { id title + resourcePath upvoteCount } pageInfo { @@ -82,7 +83,7 @@ jobs: if (discussion.title.startsWith('Vote ' + currentYear)) { const appName = discussion.title.split(': ')[1].split(' by ')[0]; votes[appName] = { - id: discussion.id, + slug: discussion.resourcePath, votes: discussion.upvoteCount }; } diff --git a/src/pages/index.astro b/src/pages/index.astro index 3281112..8efb6bb 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -61,7 +61,7 @@ const sortedApps = allApps.sort((a, b) => {
{sortedApps.map((app) => ( -
+
@@ -81,19 +81,26 @@ const sortedApps = allApps.sort((a, b) => {
-
-

{app.data.name}

+ -

by {app.data.author}

+ +

{app.data.description}

diff --git a/src/utils/votes.ts b/src/utils/votes.ts index 71375ba..0d6722d 100644 --- a/src/utils/votes.ts +++ b/src/utils/votes.ts @@ -1,6 +1,6 @@ export interface VoteData { [appName: string]: { - id: string; + slug: string; votes: number; }; }