diff --git a/lib/routes/huggingface/blog-community.ts b/lib/routes/huggingface/blog-community.ts index e0bc18436..9020a873c 100644 --- a/lib/routes/huggingface/blog-community.ts +++ b/lib/routes/huggingface/blog-community.ts @@ -54,7 +54,7 @@ interface AuthorData { interface Post { _id: string; - authorData: AuthorData; + authorsData: AuthorData[]; canonical: boolean; isUpvotedByUser: boolean; numCoauthors: number; @@ -64,6 +64,7 @@ interface Post { title: string; upvotes: number; thumbnail?: string; + url: string; } interface CommunityBlogApiResponse { @@ -83,9 +84,9 @@ async function handler(ctx) { const lists = posts.map((item) => ({ title: item.title, - link: `https://huggingface.co/blog/${item.authorData.name}/${item.slug}`, + link: `https://huggingface.co${item.url}`, pubDate: parseDate(item.publishedAt), - author: item.authorData.fullname || item.authorData.name, + author: item.authorsData?.[0]?.fullname || item.authorsData?.[0]?.name || 'Unknown', upvotes: item.upvotes, image: item.thumbnail ? new URL(item.thumbnail, 'https://huggingface.co').toString() : undefined, })); diff --git a/lib/routes/huggingface/blog.ts b/lib/routes/huggingface/blog.ts index c8381ae82..ac33b7af4 100644 --- a/lib/routes/huggingface/blog.ts +++ b/lib/routes/huggingface/blog.ts @@ -18,6 +18,7 @@ interface BlogItem { upvotes: number; thumbnail: string; tags: string[]; + url: string; } interface BlogApiResponse { @@ -55,7 +56,7 @@ async function handler() { const lists = allBlogs.map((blog) => ({ title: blog.title, - link: `https://huggingface.co/blog/${blog.slug}`, + link: `https://huggingface.co${blog.url}`, pubDate: parseDate(blog.publishedAt), author: blog.authorsData.map((author) => ({ name: author.fullname || author.name,