- rehype-link-cards.ts 构建期插件:段落仅含一个链接才转卡(内联链接 保持普通样式);fetch OG/twitter 元信息(UA 伪装、4s 超时、只读前 200KB)+ favicon 兜底;任何失败回落普通链接,构建绝不因外部站点挂 - content/.link-cache.json 入仓缓存(30 天刷新,构建确定性与零重复 请求);单篇上限 10 卡、并发 4,超出回落 - LinkCardStyles.astro 灰阶卡片样式:hairline+圆角、favicon 16px、 标题一行/描述两行截断、域名 mono、OG 图右侧 88px(无图不占位)、 hover 1px 微浮(reduced-motion 豁免)、纯 CSS 零 JS - 安全:抓取内容全 escaping、图片地址仅 http(s) - @astrojs/markdown-remark 依赖(Astro 7 换默认 markdown 处理器后 自定义插件必须经此包生效) - 样张 content/posts/link-cards-test.md(tags 含 hidden,活样例不列出) 修复说明:264148f 提交时误带入 archives 页面对 LinkCardStyles 的 import(两车道共改同一文件),本笔补全组件与插件,恢复构建仓可用。 教训:跨车道共改文件,staged 前必须看 diff 归属。 车道:op-artalk;收编复验:本地构建 45 页 + 卡片渲染(后续专项复验) 验证: pnpm astro build 45 页 exit 0;link-cards 样张页渲染正常 Spec: none (链接卡片,车道级交付) Co-authored-by: GLM-5.3
31 lines
779 B
JSON
31 lines
779 B
JSON
{
|
|
"name": "wait4x-blog",
|
|
"type": "module",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "astro dev",
|
|
"build": "astro build",
|
|
"preview": "astro preview",
|
|
"astro": "astro"
|
|
},
|
|
"dependencies": {
|
|
"@astrojs/rss": "^4.0.19",
|
|
"@astrojs/sitemap": "^3.7.4",
|
|
"@fontsource-variable/noto-sans-sc": "^5.3.1",
|
|
"@fontsource-variable/noto-serif-sc": "^5.3.1",
|
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
"@fontsource/noto-sans-sc": "^5.3.1",
|
|
"astro": "^7.3.8",
|
|
"astro-pagefind": "^2.0.1",
|
|
"exifr": "^7.1.3",
|
|
"lxgw-wenkai-screen-webfont": "^1.7.0",
|
|
"sharp": "^0.35.5"
|
|
},
|
|
"devDependencies": {
|
|
"@astrojs/markdown-remark": "^7.3.5",
|
|
"@fontsource/noto-serif-sc": "^5.3.1",
|
|
"playwright": "^1.64.1"
|
|
}
|
|
}
|