維護記錄

完成的工作

  • 精簡博客文章 tags 體系:採用方案 A(激進精簡),將 content/posts/ 下 218 篇文章的 13 個 tag 收斂為 7 個。✅
    • 合併到 開發工具分佈式建站Algorithm(子主題歸併)
    • 新增 雜談金錢新聞文字(單例容納)
    • 清理重複條目:3 篇文章的 tags 數組中存在同一 tag 多次出現的情況,強制去重
    • 批量執行腳本:/tmp/consolidate-tags.mjs(Node v24,原地編輯 frontmatter 的 tags 行,其餘內容保持不變)
    • 改動文件數:14 篇(佔 218 篇的 6.4%)
    • 最終分佈:日誌 95 / 開發 49 / 思考 40 / 軟路由 14 / 學習 10 / 安全 6 / 雜談 3

遇到的問題

  • 我的初步 “+9” 淨變化預測在數學上出現 ±1 偏差,實際 開發 為 +4 而非 +9,原因是 20260312[0443ef].md 同時擁有 建站工具,dedup 後只貢獻 1 個 開發 出現次數;同樣原本預測裡的邊界情況需用真實全局計數複核。⚠️ - 不影響最終結果,僅是粗算與精算的偏差。

下次建議

  • 新增文章時建議優先複用現有 7 個 tag,僅在確有跨類目需求時再討論是否擴展。
  • scripts/ 下考慮沉澱 consolidate-tags.mjs 為可重入工具,便於後續調整 tag 體系時一鍵重跑 + 校驗;當前實現還停留在 /tmp/ 裡,無版本控制。

完成的工作 (續)

  • 修復 layouts/partials/custom_footer.html 的渲染範圍:之前 1 行 stub 把 layouts/partials/footer.html 轉交給 custom_footer.html,而後者只塞了 Cloudflare Analytics,等於屏蔽了 PaperMod 的全部 footer 功能,包括回頂按鈕、代碼複製按鈕、主題切換 JS、菜單滾動位置記憶、版權/Powered by 致謝等。✅
  • 恢復 PaperMod 原版 _partials/footer.html 的全部內容:版權/年份、Powered by Hugo & PaperMod#top-link 錨點和 SVG、滾動監聽 JS、平滑滾動 JS、#theme-toggle JS、copy-code 按鈕 JS;同時保留 PaperMod 的 {{- partial "extend_footer.html" . }} 鉤子。✅
  • 保留 Cloudflare Web Analytics:在新版的 custom_footer.html 末尾保留原有的 {{- with site.Params.cloudflareAnalytics.token }} 注入邏輯,並 hugo --minify 構建後用 grep 校驗 id=top-link / copy-code / Powered by / class=footer / menu-scroll / cf-beacon 在生成的 public/posts/.../index.html 中重新出現。✅

遇到的問題 (續)

  • Hugo minifier 會把 <footer class="footer"> 壓縮成 <footer class=footer>,第一次 grep "class=\"footer\"" 給出 0 命中導致誤判;改為匹配 class=footer 即可。無功能影響。⚠️

下次建議 (續)

  • 當前 custom_footer.html--ultra-compact 等價於"複製粘貼 PaperMod 原內容",會帶來一個問題:PaperMod 子模塊後續升級 footer 時此處不會自動同步。如果想跟進官方 footer 改進,可以改用 layouts/partials/footer.html{{ block "footer" . }}{{ end }} 或類似模式避免硬編碼;短期內(PaperMod 不會有大改)維持現狀即可。