diff --git a/content/site/about.yaml b/content/site/about.yaml new file mode 100644 index 0000000..cd4363f --- /dev/null +++ b/content/site/about.yaml @@ -0,0 +1,5 @@ +# 关于页可变段落(后台「页面文案 → 关于页」可改) +# intro = 身份陈述段;留空则回落默认文案,构建不炸 +intro: + zh: 写作者 · 读者 · 快门按压者,拥抱开源。这里是我三条轨道的公开工作台:读过的书留下评注,写过的代码进项目墙,按下的快门收入图库。 + en: Writer · Reader · Shutter-presser, embracing open source. This is the public workbench of my three tracks — books that left notes, code that reaches the project wall, and shutters I pressed. diff --git a/content/site/home.yaml b/content/site/home.yaml new file mode 100644 index 0000000..8906933 --- /dev/null +++ b/content/site/home.yaml @@ -0,0 +1,5 @@ +# 主页身份语(后台「页面文案 → 主页设置」可改) +# zh/en 双字段,页面按 locale 取;留空则回落到 src/lib/site-content.ts 的默认文案 +tagline: + zh: 写作者 · 读者 · 快门按压者,拥抱开源。 + en: Writer · Reader · Shutter-presser — embracing open source. diff --git a/content/site/opensource.yaml b/content/site/opensource.yaml new file mode 100644 index 0000000..f10b3a1 --- /dev/null +++ b/content/site/opensource.yaml @@ -0,0 +1,13 @@ +# 开源页叙述(后台「页面文案 → 开源页」可改) +# blurb = 链接前文案,repo_* 拼成仓链接,blurb_after = 链接后文案;任一留空回落默认 +blurb: + zh: 本站本身即开源: + en: 'This site is itself open source: ' +repo_url: https://git.wait4x.online/wait4x/blog +repo_label: git.wait4x.online/wait4x/blog +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. +# 置顶项目(跨源手选,顺序即展示顺序;name = 仓库短名)。原 projects.ts 硬编码名单迁于此 +pinned: + - blog diff --git a/docs/写作指南.md b/docs/写作指南.md index ec366ec..8a1ec28 100644 --- a/docs/写作指南.md +++ b/docs/写作指南.md @@ -65,6 +65,24 @@ public/media/my-post/clip.mp4 ← 文件放这里 见 `content/posts/media-sample.md`(draft 文章,仅构建验证用,不上线)。 +## 链接卡片(OG 预览卡) + +**一行只放一个链接、且它独立成段**时,构建期会抓取该页的 OG 信息渲染成卡片(标题 / 描述 / 站点图标 / 可选缩略图): + +```markdown +https://astro.build/ + +[也可以是 markdown 链接形态](https://astro.build/) +``` + +规则与边界: + +- **内联链接不变**:夹在句子里的链接保持普通样式(`这是一句带 [链接](https://example.com) 的话` → 不会变卡),所以不会把整篇变成卡片墙 +- **抓取失败一律回落普通链接**:404、无 OG、超时(4s)、站点拒爬都不影响构建 +- **每篇最多 10 张卡**,超出的回落普通链接(防止文章变卡片流) +- **缓存**:结果存 `content/.link-cache.json`(入仓,保证构建确定性);条目 30 天后自动重抓。想强制刷新某条——删掉该 URL 的条目即可 +- 缩略图取 `og:image`,无图不占位;图标取站点而非第三方 favicon 服务 + ## 发布提醒 - push main → webhook 自动构建发布(约 10 秒) @@ -90,3 +108,45 @@ mood: "#8a6f4a" cover: ./assets/books/mian-sha.jpg --- ``` + +## 后台上传(Sveltia 后台,推荐路径) + +后台地址 `/admin/`(gitea 账号登录)。三类媒体都有后台入口,不必手写路径: + +### 图片 + +文章编辑器里插入图片 → 自动上传到 `content/posts/assets/` 并写入 `./assets/...` +相对路径(走 Astro 图片管线,自动优化)。**不要手改成 `/assets/...` 绝对路径**。 + +### 视频(frontmatter 字段,正文后自动渲染) + +1. 文章编辑页「附视频」字段上传(自动落 `public/media/`,路径写 `/media/.mp4`) +2. 正文读完后自动出现 `