From 16b9ad25d3ddc58a795e6ebd7df5b7abd080b4a7 Mon Sep 17 00:00:00 2001 From: helti Date: Wed, 15 Jan 2025 19:46:30 +0800 Subject: [PATCH] feat: github --- src/routes/github.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/routes/github.ts b/src/routes/github.ts index de069ae..32fe496 100644 --- a/src/routes/github.ts +++ b/src/routes/github.ts @@ -42,6 +42,7 @@ export const handleRoute = async (c: ListContext) => { const type = isTrendingType(typeParam) ? typeParam : "daily"; const listData = await getTrendingRepos(type); + const routeData = { name: "github", title: "github 趋势", @@ -54,7 +55,18 @@ export const handleRoute = async (c: ListContext) => { }, link: `https://github.com/trending?since=${type}`, total: listData?.data?.length || 0, - ...listData, + ...{ + ...listData, + data: listData?.data?.map((v, index)=>{ + return { + id:index, + title: v.repo, + desc: v.description, + hot: v.stars, + ...v + } + }) + } }; return routeData; };