This commit is contained in:
@ -23,7 +23,8 @@ if (blogData === null) {
|
||||
}
|
||||
|
||||
const tree = await toMarkdocTree(blogData.content)
|
||||
const formatDate = (date: Date) => `${date.getFullYear()} 年 ${date.getMonth() + 1} 月 ${date.getDate()} 日`
|
||||
const formatDate = (date: Date) =>
|
||||
`${date.getFullYear()} 年 ${date.getMonth() + 1} 月 ${date.getDate()} 日`
|
||||
---
|
||||
|
||||
<FullLayoutV1 title={blogData.title} withGap>
|
||||
@ -43,22 +44,34 @@ const formatDate = (date: Date) => `${date.getFullYear()} 年 ${date.getMonth()
|
||||
<main>
|
||||
<h1>{blogData.title}</h1>
|
||||
{
|
||||
blogData.author && <div class="blog-info">
|
||||
<a class="author" href=`https://legacy.passthem.top/user/${blogData.author.username}`>
|
||||
<div class="avatar">
|
||||
<Image class="image" src={blogData.author.avatar.image_url}
|
||||
width={32} height={32} alt=`用户 ${blogData.author.nickname} 的头像` />
|
||||
blogData.author && (
|
||||
<div class="blog-info">
|
||||
<a
|
||||
class="author"
|
||||
href={`https://legacy.passthem.top/user/${blogData.author.username}`}
|
||||
>
|
||||
<div class="avatar">
|
||||
<Image
|
||||
class="image"
|
||||
src={blogData.author.avatar.image_url}
|
||||
width={32}
|
||||
height={32}
|
||||
alt={`用户 ${blogData.author.nickname} 的头像`}
|
||||
/>
|
||||
</div>
|
||||
<div class="username">{blogData.author.nickname}</div>
|
||||
</a>
|
||||
<span class="split">・</span>
|
||||
<span>{formatDate(blogData.updated_at)} 更新</span>
|
||||
</div>
|
||||
<div class="username">{blogData.author.nickname}</div>
|
||||
</a>
|
||||
<span class="split">・</span>
|
||||
<span>{ formatDate(blogData.updated_at) } 更新</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<article>
|
||||
<MarkdocTreeRender tree={tree} client:load />
|
||||
</article>
|
||||
<h1 class="comment-title"><Icon name="material-symbols:chat-rounded" /> 评论区</h1>
|
||||
<h1 class="comment-title">
|
||||
<Icon name="material-symbols:chat-rounded" /> 评论区
|
||||
</h1>
|
||||
<Artalk client:idle />
|
||||
</main>
|
||||
</FullLayoutV1>
|
||||
@ -123,7 +136,7 @@ const formatDate = (date: Date) => `${date.getFullYear()} 年 ${date.getMonth()
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: .25rem;
|
||||
gap: 0.25rem;
|
||||
|
||||
& > .avatar {
|
||||
& > .image {
|
||||
@ -149,7 +162,7 @@ const formatDate = (date: Date) => `${date.getFullYear()} 年 ${date.getMonth()
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: .25rem;
|
||||
gap: 0.25rem;
|
||||
|
||||
&.comment-title {
|
||||
margin-block-start: 3rem;
|
||||
|
||||
Reference in New Issue
Block a user