feat: github

This commit is contained in:
helti
2025-01-15 19:46:30 +08:00
parent be9db7c625
commit 16b9ad25d3

View File

@@ -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,
data: listData?.data?.map((v, index)=>{
return {
id:index,
title: v.repo,
desc: v.description,
hot: v.stars,
...v
}
})
}
};
return routeData;
};