Commit Graph
16 Commits
Author SHA1 Message Date
zqlit 571d552c9d fix(build): 消除构建期远程拉取隐患 + 评论提交反馈 + 友链卡片移动端
构建隐患(本次丢构建的根因)
- footer.html 用 resources.GetRemote 在每个页面渲染时拉 api/links 与 api/feeds,
  构建节点连不上 Cloudflare 时重试撞穿 Hugo partial 30s 超时 → 整站构建失败
- 改为「流水线 curl 快照 + 模板读本地文件」:
  · 新增 scripts/fetch_snapshots.sh,一次拉齐 conf / friend_links / friend_feeds
    (--max-time 30 --retry 2,JSON 校验,失败一律删文件且恒 exit 0)
  · .cnb.yml Hugo 构建 stage 改为调用该脚本
  · footer.html 改读 site.Data.friend_links / site.Data.friend_feeds,缺失渲染空值
  · .gitignore 忽略 /data/friend_links.json 与 /data/friend_feeds.json
- 降级实测:删掉快照后构建仍 EXIT=0,产物 friendLinks 为空数组

评论提交反馈(artalk.js 新增 __atkSubmit 模块)
- 校验:config.beforeSubmit 拦下 内容空 / 昵称空 / 邮箱空 / 邮箱格式错(网址不校验)
- 发送中:editor-submit 常驻 loading,超 7s 补「网络较慢」
- 成功:editor-submitted 按 normal/reply/edit 分文案,is_pending 提示等待审核
- 失败:拦 POST /api/v2/comments,403/429/4xx/5xx/网络异常全部翻译成人话
- 失败时输入内容保留,并清掉 Artalk 自带的重复小字通知
- 无头浏览器实测 19/19 通过(POST 走 mock,未向线上写数据)

友链申请卡片移动端
- max-width:640px 下隐藏 .atk-fl-nick(昵称 + 博主徽章),桌面端不变

改动:6 files, +282 / -61
2026-10-04 17:38:04 +08:00
zqlit 50a906e07c perf(comments): 评论加载提速 + 骨架屏 + 友链弹窗 pjax 修复 + toast 统一 Message.js
优化:
- initArtalk 加节点级幂等守卫(mount.__atkInited,失败回滚),
  消除 artalk.html/mypjax 多入口导致的 4× comments + 4× pv 重复请求
- fetch 包装层对无 body 的 GET/HEAD 去掉多余 content-type,
  消掉 Artalk 对 GET /comments 的 CORS 预检(按完整 URL 缓存,
  每篇文章都重付一次 RTT)。实测评论列表 +1150~1565ms → +626ms

修复:
- 评论列表骨架屏改注入 .atk-list-body(原骨架在 #Comments 内,
  被 Artalk.init 清空),list-loaded/故障/12s 兜底移除
- 友链申请弹窗抽成 modules/friendlink.js 进 page-only bundle
  (原内联脚本在 #pjax-container 外,pjax 后 flApplyOpenModal 未定义)
- toast 统一走本地化 Message.js/Qmsg 适配层(保留 window.Toast/showToast 旧 API)

文档:
- README / 架构总览 更新;新增 评论加载优化方案.md
2026-10-04 15:00:52 +08:00
zqlit bcc2236bde ci: 迁移到 CNB 流水线(.cnb.yml)+ 零依赖邮件通知
- .cnb.yml:6 个 stage 顺序执行(Hugo 构建 → 又拍云 sync → 又拍云 purge →
  多吉云刷新 → EdgeOne 部署 → 上报状态);push 与每日 09:00 定时任务
  共用同一组 stage(YAML 锚点),失败通知走 failStages
- 又拍云保持「非阻断但如实上报」:allowFailure 沿用原版 continue-on-error
  语义,国内线路直传失败不拖垮境外线路
- scripts/send_mail.js:零依赖 SMTP 发信(node net/tls,465 隐式 TLS +
  587 STARTTLS),变量名沿用 MAIL_USERNAME / MAIL_PASSWORD
- 密钥经 imports 从密钥仓库 zqlit/blog-secrets 注入(共 10 项)
- .gitignore:补 cnb-secrets.yml 本地粘贴草稿(含真实令牌,不入库)

原 GitHub Actions 里的 artifact 传递 / COS 中转 / 广州机 sync.sh 轮询
整条链在此不再需要 —— 其唯一根因是 runner 在境外,CNB 节点在国内。
2026-10-04 12:56:05 +08:00
zqlit e0218b42bb docs: 迁 CNB 前的架构决策文档 + 构建骨架
- 决策文档:架构总览 / 代码源与构建平台选型 / CNB构建落地方案 /
  EdgeOne双区域 / Gitee / 阿里云ESA / 精简方案
- CNB 构建骨架:deploy/Dockerfile、bin/linux/hugo
  (84MB,linux/amd64 extended 0.128.2,供 CNB 容器 COPY 用)
- scripts/setup-cnb-remotes.sh:双远端切换(CNB 主仓 + GitHub 备份)
- .gitignore 补 .workbuddy/(工作数据不入库)
2026-10-04 12:40:17 +08:00
zqlit 2388694e8a chore: 砍COS改造(deploy.yml改artifact传递+gitea-backup可移植部署包+改造步骤文档) 2026-10-04 09:52:50 +08:00
zqlit f64d8f30f3 chore: 清理误提交的 .claude/worktrees gitlink
Deploy to Production / pre-check (push) Successful in 3m35s
Deploy to Production / build (push) Failing after 10m9s
Deploy to Production / deploy-edgeone (push) Skipped
Deploy to Production / deploy-upyun (push) Skipped
Deploy to Production / finalize (push) Skipped
Deploy to Production / notify-failure (push) Successful in 7s
- 移除 4 个空目录 gitlink(导致 checkout 报 No url found for submodule path)
- .gitignore 忽略 .claude/worktrees/
2026-09-30 20:30:08 +08:00
zqlit 013dce4f9f 0520发布文章 2026-05-21 00:27:35 +08:00
zqlit 56a196e815 修复url渲染逻辑 2026-05-19 09:53:08 +08:00
Vaica 38e29b6ceb added 修复css样式 2026-02-16 14:24:13 +08:00
Vaica 744d6cce8b fixed 友圈bug 2026-01-21 23:18:35 +08:00
Vaica 4d99c5a9cd 2025.11.21 修改gitignore文件 2025-11-21 16:32:00 +08:00
小赵同学 28f74e7a38 1.28 2025-01-28 21:13:15 +08:00
小赵同学 bef22487b1 修复若干配置 2025-01-14 10:16:22 +08:00
小赵同学 3bf5275614 Update .gitignore 2025-01-03 09:46:11 +08:00
小赵同学 5638789c6b Update .gitignore 2024-12-22 10:27:36 +08:00
小赵同学 945e1f0e4d 12.17 2024-12-17 21:18:24 +08:00