Skip to content

Commit

Permalink
feat(route): add cool paper first-author infomation (DIYgod#17857)
Browse files Browse the repository at this point in the history
* [update] update cool paper

* [add] add author of cool paper
  • Loading branch information
Muyun99 authored Dec 11, 2024
1 parent e1c5e63 commit 7c5a04f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/routes/papers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand All @@ -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,
Expand Down Expand Up @@ -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' },
Expand All @@ -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'],

Expand Down
4 changes: 4 additions & 0 deletions lib/routes/papers/templates/description.art
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<a href="{{ kimiUrl }}">[Kimi]</a>
{{ /if }}

{{ if authorString }}
<p><b>Authors:</b> {{ authorString }}</p>
{{ /if }}

{{ if summary }}
<p>{{ summary }}</p>
{{ /if }}

0 comments on commit 7c5a04f

Please sign in to comment.