Skip to content

Commit 5fbc16e

Browse files
committed
feat: link research.json publication IDs to publications.json titles and arXiv links
1 parent e2084b1 commit 5fbc16e

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

src/pages/Research.jsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { Title } from '@/components';
2-
import { research } from '@/data';
2+
import { research, publications } from '@/data';
33

44
const Research = () => {
55
const data = research.data;
6-
6+
const pubIndex = new Map(
7+
publications.map(p => [p.Id, { title: p.Title, arxiv: p.ArXiv }])
8+
);
9+
710
return (
811
<div className="pages">
912
<Title name="Research" />
@@ -46,15 +49,24 @@ const Research = () => {
4649
<span className="font-bold">{'Publications: '}</span>
4750
<span>
4851
{item.Publication.length > 0
49-
? <ul>
50-
{Object.entries(item['Publication']).map(([key, value], index) =>
51-
<li key={`publication-${index}`} className="list-[circle] ml-8">
52-
<span className="font-bold">{`${key}: `}</span>
53-
<span >{value}</span>
54-
</li>
55-
)}
56-
</ul>
57-
: <span className="text-ugray italic">It will be updated soon.</span>
52+
? (
53+
<ul>
54+
{item.Publication.map((id) => {
55+
const pub = pubIndex.get(id);
56+
if (!pub) return null;
57+
return (
58+
<li key={`publication-${id}`} className="list-[circle] ml-8">
59+
{
60+
pub.arxiv
61+
? (<a href={pub.arxiv} target="_blank" rel="noreferrer" className="italichover:text-blue-500">{pub.title}</a>)
62+
: (<span>{pub.title}</span>)
63+
}
64+
</li>
65+
);
66+
})}
67+
</ul>
68+
)
69+
: (<span className="text-ugray italic">It will be updated soon.</span>)
5870
}
5971
</span>
6072
</li>

0 commit comments

Comments
 (0)