diff --git a/README.md b/README.md index 827f463..bb6793a 100644 --- a/README.md +++ b/README.md @@ -241,18 +241,17 @@ prose-p:leading-[1.78] md:prose-p:leading-[1.85] | 区块 | 内容 | 显示范围 | |---|---|---| -| 我的介绍 | 头像 + 站名 + 签名,**整块可点去 `/about/`** | 全部 | +| 站点信息卡片 | 建站时间 / 已运行 / 文章 / 偶得 / 总字数 / 最近更新,卡片样式沿用侧栏作者卡片 | 全部 | | 最新文章 | 最近 4 篇(按发布时间倒序,不把置顶提前) | 桌面 | | 联系 | 社交图标 + 订阅 RSS | 全部 | -| 站点信息 | 建站时间 / 已运行 / 文章 / 偶得 / 总字数 / 最近更新 | 全部(想只在桌面显示就给它加 `hidden md:grid`) | | 底栏 | 版权 / 备案 / 主题署名 | 全部 | -**原来的「导航」栏已删除** —— 它是顶部导航的逐项复制(9 条名字和目标完全一样),手机上白占 312px。桌面端改用「最新文章」,把重复变成发现。不影响 SEO:顶部导航和移动端菜单里的链接在每页 HTML 里都还在。 +两处**刻意不放**的东西: -两点需要注意: +- **「导航」栏已删除** —— 它是顶部导航的逐项复制(9 条名字和目标完全一样),手机上白占 312px。桌面端改用「最新文章」,把重复变成发现。不影响 SEO:顶部导航和移动端菜单里的链接在每页 HTML 里都还在。 +- **页脚不再放「我的介绍」** —— 侧栏作者卡片已经有了,再放一份是重复。页脚那份的视觉位置让给了站点信息卡片。 -- **「我的介绍」整块包 `` 是合法的**,因为这一块里没有别的链接。但**侧栏的作者卡片不行** —— 它下面有社交图标(本身是 ``),`` 不能嵌套。所以那里只包到签名那一段。 -- 整块链接要给 `aria-label`,否则读屏会把「头像 alt + 站名 + 签名」整段念成链接名。 +「我的介绍 → 关于页」在**侧栏作者卡片**里(`sidebar.tsx`):站名和签名那两行包在同一个 `` 里,不做 hover 装饰。只能包这两行——下面的社交图标本身是 ``,`` 不能嵌套 ``。`aria-label` 是必须的,否则读屏会把「站名 + 签名」念成链接名。 统计数据在 `src/lib/site-stats.ts`:文章数/偶得数/分类数/标签数/总字数在构建时算,「已运行 N 天」和「最近更新」由页脚里的内联脚本按**真实时间**刷新(站点久不重建也不会停在构建那天),服务端会先渲染一份构建时兜底值,关 JS 也不空。加减统计项改 `footer.astro` 里的 `statCells` 数组即可。 diff --git a/src/components/footer.astro b/src/components/footer.astro index 6f46f67..1566f0d 100644 --- a/src/components/footer.astro +++ b/src/components/footer.astro @@ -1,6 +1,6 @@ --- import type { ComponentType, SVGProps } from "react" -import { ArrowRight, Github, Mail, Music, Rss } from "lucide-react" +import { Github, Mail, Music, Rss } from "lucide-react" import { QqIcon } from "@/components/icons/qq-icon" import { profile, type ExternalProfileLink, type ExternalProfileLinkType } from "@/data/profile" import { site } from "@/data/site" @@ -32,30 +32,27 @@ const statCells = [
{/* - 我的介绍:整块可点去关于页(这里没有嵌套链接,所以整块包 是合法的)。 - aria-label 是为了不让读屏把头像 alt + 站名 + 签名全念成链接名。 + 站点信息卡片:沿用侧栏作者卡片/分类卡片的语言 + (bg-card + border/50 + rounded-xl + 红色短竖线标题)。 + 「我的介绍」不在这里重复展示 —— 侧栏作者卡片已经有了。 */} - -
-
- {profile.name} -
- - {site.name} - +
+
+
+

站点信息

-

{profile.bio}

- - 关于我 - - -
+
+ {statCells.map((cell) => ( +
+
{cell.label}
+
+ {cell.value} + {cell.unit && {cell.unit}} +
+
+ ))} +
+
{/* 最新文章:手机端上面就是文章列表,再列一遍没意义,所以只在 md 以上显示。 @@ -109,21 +106,8 @@ const statCells = [
- {/* 站点信息:桌面 6 列一行,手机 3 列两行 */} -
- {statCells.map((cell) => ( -
-
{cell.label}
-
- {cell.value} - {cell.unit && {cell.unit}} -
-
- ))} -
- {/* Bottom */} -
+

© {site.startDate.slice(0, 4)} {profile.name}. All rights reserved.

diff --git a/src/components/sidebar.tsx b/src/components/sidebar.tsx index bb846a5..6a31a56 100644 --- a/src/components/sidebar.tsx +++ b/src/components/sidebar.tsx @@ -2,7 +2,7 @@ import { useState, type ReactNode } from "react" import { cn } from "@/lib/utils" -import { ArrowRight, Calendar } from "lucide-react" +import { Calendar } from "lucide-react" import { profile } from "@/data/profile" import { ProfileContactLink } from "@/components/profile-contact-link" @@ -39,29 +39,23 @@ export function Sidebar({ return (