Skip to content

Commit f21a24c

Browse files
committed
paper 组件支持显示作者
1 parent 6bb6de4 commit f21a24c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/pure/components/pages/Paper.astro

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Paper = {
1717
star?: number
1818
tags?: string[]
1919
paperUrl?: string // 新增论文链接字段
20-
author?: string
20+
author?: string[]
2121
}
2222
index?: number
2323
}
@@ -101,6 +101,14 @@ const starCount = data.star ? Math.min(Math.max(data.star, 0), 5) : 0
101101
</span>
102102
)
103103
}
104+
{
105+
Array.isArray(data.author) && data.author.length > 0 && (
106+
<span class='flex items-center gap-1.5'>
107+
<Icon name='brain' class='size-4' />
108+
{data.author.map((author: string) => author.trim()).join(', ')}
109+
</span>
110+
)
111+
}
104112
</div>
105113

106114
{/* 元信息 - DOI 和 ISBN */}
@@ -268,7 +276,9 @@ const starCount = data.star ? Math.min(Math.max(data.star, 0), 5) : 0
268276
padding-bottom: 0.25rem;
269277
border-radius: var(--radius);
270278
border: 1px solid rgb(226, 232, 240);
271-
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
279+
box-shadow:
280+
0 4px 6px -1px rgb(0 0 0 / 0.05),
281+
0 2px 4px -2px rgb(0 0 0 / 0.05);
272282
transition: border-color 0.3s;
273283
}
274284

0 commit comments

Comments
 (0)