mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-23 02:31:31 +08:00
fix: 修复归档页面链接生成错误
- 修复归档页面中文章链接生成错误的问题 - 根据文章类型(post或note)动态生成链接,将post指向/posts/,note指向/notes/
This commit is contained in:
@ -94,7 +94,10 @@ const descYearKeys = Object.keys(groupedByYear).sort((a, b) => +b - +a);
|
||||
<ul class="flex flex-wrap gap-2">
|
||||
{latestUpdatedPost.map((post) => (
|
||||
<li>
|
||||
<a href={`/${post.collection}/${post.id}/`} class="hover:text-link">
|
||||
<a
|
||||
href={`${post.collection === "post" ? "/posts/" : "/notes/"}${post.id}/`}
|
||||
class="hover:text-link"
|
||||
>
|
||||
<span>{post.data.date_modified.toLocaleDateString()}</span>
|
||||
{post.data.title}
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user