From 7c5a04fa7a06a61708215d374eb00a1d9a5355e0 Mon Sep 17 00:00:00 2001 From: Yun Du <27944418+Muyun99@users.noreply.github.com> Date: Thu, 12 Dec 2024 01:34:07 +0800 Subject: [PATCH] feat(route): add cool paper first-author infomation (#17857) * [update] update cool paper * [add] add author of cool paper --- lib/routes/papers/index.ts | 8 +++++--- lib/routes/papers/templates/description.art | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index ead2927feb3098..3f0f0b0f8201ec 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -34,10 +34,12 @@ export const handler = async (ctx) => { const kimiUrl = new URL(id, apiKimiUrl).href; const pdfUrl = Object.hasOwn(pdfUrlGenerators, site) ? pdfUrlGenerators[site](id) : undefined; + const authorString = item.author; const description = art(path.join(__dirname, 'templates/description.art'), { pdfUrl, siteUrl: item.link, kimiUrl, + authorString, summary: item.summary, }); @@ -47,7 +49,7 @@ export const handler = async (ctx) => { pubDate: parseDate(item.pubDate ?? ''), link: item.link, category: item.categories, - author: item.creator, + author: authorString, doi: `${site}${id}`, guid, id: guid, @@ -77,7 +79,7 @@ export const route: Route = { path: '/:category{.+}?', name: 'Topic', url: 'papers.cool', - maintainers: ['nczitzk'], + maintainers: ['nczitzk', 'Muyun99'], handler, example: '/papers/arxiv/cs.AI', parameters: { category: 'Category, arXiv Artificial Intelligence (cs.AI) by default' }, @@ -91,7 +93,7 @@ export const route: Route = { | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | - | arXiv Robotics (cs.RO) | arxiv/cs.RO | + | arXiv Robotics (cs.RO) | arxiv/cs.RO | `, categories: ['journal'], diff --git a/lib/routes/papers/templates/description.art b/lib/routes/papers/templates/description.art index 368ea61f8ee842..0c11cd60997369 100644 --- a/lib/routes/papers/templates/description.art +++ b/lib/routes/papers/templates/description.art @@ -10,6 +10,10 @@ [Kimi] {{ /if }} +{{ if authorString }} +

Authors: {{ authorString }}

+{{ /if }} + {{ if summary }}

{{ summary }}

{{ /if }} \ No newline at end of file