作者卡片的状态小字挪到 profile.ts,文案可配置

「正在空降:超级地球」原来硬编码在 sidebar.tsx 里,找起来费劲 ——
个人可见的文案应该和其它个人资料放一起。

- src/data/profile.ts 新增 status 字段,默认值就是原来那句
- sidebar.tsx 改成读 profile.status;值为空字符串时整行(含分隔线)不渲染
- README 里三处 profile.ts 的说明补上「状态小字」

验证:构建产物中该文案仍渲染 1 处。
This commit is contained in:
dsh
2026-09-15 10:13:45 +08:00
parent 056b5faf98
commit 121a03dd85
3 changed files with 15 additions and 10 deletions
+9 -7
View File
@@ -72,13 +72,15 @@ export function Sidebar({
})}
</div>
{/* Quick Stats */}
<div className="flex items-center justify-center gap-4 text-xs text-muted-foreground pt-4 border-t border-border/50">
<span className="flex items-center gap-1">
<Calendar className="w-3 h-3" />
正在空降:超级地球
</span>
</div>
{/* Quick Stats —— 文案在 src/data/profile.ts 的 profile.status,留空则整行不显示 */}
{profile.status && (
<div className="flex items-center justify-center gap-4 text-xs text-muted-foreground pt-4 border-t border-border/50">
<span className="flex items-center gap-1">
<Calendar className="w-3 h-3" />
{profile.status}
</span>
</div>
)}
</div>
{/* Categories —— 移动端由 article-list 顶部的吸附胶囊条代替,这里只在 lg 以上显示 */}
+3
View File
@@ -32,12 +32,15 @@ export const profile: {
bio: string
avatar: string
email: string
/** 作者卡片底部那行状态小字(带日历图标)。留空则整行不显示。 */
status: string
links: ProfileLink[]
} = {
name: "时之刃",
bio: "只是将博客作为新的爱好的普通人!",
avatar: "/avatar.webp",
email: EMAIL,
status: "正在空降:超级地球",
links: [
{
type: "github",