添加格式化相关
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-07 03:27:22 +08:00
parent 2a71d714e8
commit d605131bda
13 changed files with 904 additions and 143 deletions

View File

@ -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;