diff --git a/content/site/opensource.yaml b/content/site/opensource.yaml index 5041226..765d4df 100644 --- a/content/site/opensource.yaml +++ b/content/site/opensource.yaml @@ -9,11 +9,20 @@ typing: - zh: 书与快门都在一个工作台 en: Books and shutters, one workbench +# 开篇叙述(5j T1):markdown 富文本,链接内联写 `[文字](url)`。 +# 非空时整段走富文本管线(净化 + 排版类白名单),**取代**下面的 blurb + repo_* + blurb_after 拼接。 +story: + zh: "本站本身即开源:[git.wait4x.online/wait4x/blog](https://git.wait4x.online/wait4x/blog) —— Astro SSG、双写作流、构建发布全链皆在仓中。以下是我在自托管 gitea 与 GitHub 上的全部公开仓库,以及最近一年的贡献活动。" + en: "This site is itself open source: [git.wait4x.online/wait4x/blog](https://git.wait4x.online/wait4x/blog) — the Astro SSG, dual-writing workflow, and the full build & deploy pipeline live in the repo. Below are all my public repositories on self-hosted gitea and GitHub, plus contributions from the past year." + +# ---- legacy(story 为空时才用)---- +# 下面四个字段是 5j 之前「两半夹链接」的写法,保留只为旧 yaml / 回退演示;新改动请一律写 story。 blurb: zh: 本站本身即开源: en: 'This site is itself open source:' repo_url: https://git.wait4x.online/wait4x/blog repo_label: git.wait4x.online/wait4x/blog +# legacy:story 为空时接在 story 占位处拼接(见上方 blurb 注释) blurb_after: zh: —— Astro SSG、双写作流、构建发布全链皆在仓中。以下是我在自托管 gitea 与 GitHub 上的全部公开仓库,以及最近一年的贡献活动。 en: — the Astro SSG, dual-writing workflow, and the full build & deploy pipeline live in the repo. Below are all my public repositories on self-hosted gitea and GitHub, plus contributions from the past year. diff --git a/scripts/build-perf/content-lint.mjs b/scripts/build-perf/content-lint.mjs index cbeb089..f711ccb 100644 --- a/scripts/build-perf/content-lint.mjs +++ b/scripts/build-perf/content-lint.mjs @@ -16,6 +16,9 @@ if (MODE === 'skip') { const SKIP_PREFIX = ['/admin/', '/photos-originals/']; // admin=CMS 路由;photos-originals=部署期 rsync 叠加层(不在 dist,另有部署链保障) const SKIP_FILE = new Set(['/404.html']); // Astro 404 页不参与配对 +// 一次性预览路由(无 en 对应页):完全不参与检查。用户选定方案后随路由一起删除。 +const SKIP_ALL = new Set(['/heatmap-preview/index.html']); + function walk(dir, out = []) { for (const e of readdirSync(dir)) { @@ -50,6 +53,7 @@ const warns = []; for (const f of files) { const rel = f.slice(DIST.length) || '/'; + if (SKIP_ALL.has(rel)) continue; const html = readFileSync(f, 'utf8'); // 站内 :仅根相对路径;#锚点/mailto/tel/外部/data: 全跳过 diff --git a/src/components/geek/GithubProfile.astro b/src/components/geek/GithubProfile.astro index 4ede507..b728d3c 100644 --- a/src/components/geek/GithubProfile.astro +++ b/src/components/geek/GithubProfile.astro @@ -7,7 +7,7 @@ import { Image } from 'astro:assets'; import { existsSync } from 'node:fs'; import TypingLines from './TypingLines.astro'; -import { homeAvatar, homeSocials, openSourceCopy } from '../../lib/site-content'; +import { homeAvatar, homeSocials, openSourceCopy, renderRich } from '../../lib/site-content'; import { githubUserStats, loadProjects } from '../../lib/projects'; import { iconPath } from '../../lib/icons'; import type { Locale } from '../../lib/locale'; @@ -20,6 +20,10 @@ const { locale = 'zh' } = Astro.props; const avatar = await homeAvatar(); const socials = await homeSocials(); const copy = await openSourceCopy(locale); +// 开篇叙述合一(5j T1):story 非空 → 整段走富文本管线(markdown + 内容净化 + 排版类白名单), +// 链接就是 markdown 普通链接,不再需要 blurb/blurb_after 两半夹一个 repo 链接; +// story 为空 → 回落旧的 blurb + + blurb_after 拼接(旧 yaml 零回归)。 +const storyHtml = copy.story.trim() ? await renderRich(copy.story, { inline: true }) : null; // 仓库数据:档案卡只关心"语言占比 + 星标汇总",取全量(不受项目墙可见性影响) let langs: { name: string; count: number; pct: number }[] = []; @@ -105,9 +109,13 @@ const L = { wait4x@wait4xx
- {copy.blurb}{copy.repoLabel}{' '}{copy.blurbAfter.trim()} -
+ {storyHtml ? ( + + ) : ( ++ {copy.blurb}{copy.repoLabel}{' '}{copy.blurbAfter.trim()} +
+ )}