BLOG-117 Auto generate sitemap and rss file #303

Merged
squid merged 17 commits from BLOG-117_auto_gen_sitemap_and_rss into main 2026-09-23 22:39:43 +08:00
Owner

Description

This PR generates sitemap.xml and feed.xml from the frontend instead of the manual/toolbox script, so
the public URL scheme lives in one place and the documents are never hand-mutated.

  • New SvelteKit server routes /sitemap.xml and /feed.xml, generated on demand with a short
    Cache-Control (public, max-age=300). There is no server-side cache, so the app regenerates on a
    cache miss; browsers, crawlers and any intermediary honour the header.
  • A shared PostPage entity and ListPostPagesUseCase map published posts to their public URLs using
    resolve(), so the frontend route table stays the single source of truth.
  • sitemap.xml (sitemap package) lists every published post plus the static pages only the frontend
    knows about: home, post list, and the terms documents.
  • feed.xml (feed package) contains only posts, capped at the 20 most recent. Static pages never
    appear in the feed.
  • The backend now exposes, per post, the preview image mime type and size (for a valid RSS enclosure)
    and the post updated_time. The frontend uses updated_time as sitemap lastmod, while the feed pubDate
    remains the published time.

Package Changes

Package Action Version
feed Added 6.0.0
sitemap Added 9.0.1
sanitize-html Updated 2.17.3 -> 2.17.7

No Cargo.toml changes.

Screenshots

N/A (XML endpoints).

Reference

Resolves #117

Checklist

  • A milestone is set
  • The related issues has been linked to this branch

Generated by Zed coding agent with Deepseek Flash

## Description This PR generates sitemap.xml and feed.xml from the frontend instead of the manual/toolbox script, so the public URL scheme lives in one place and the documents are never hand-mutated. - New SvelteKit server routes /sitemap.xml and /feed.xml, generated on demand with a short Cache-Control (public, max-age=300). There is no server-side cache, so the app regenerates on a cache miss; browsers, crawlers and any intermediary honour the header. - A shared PostPage entity and ListPostPagesUseCase map published posts to their public URLs using resolve(), so the frontend route table stays the single source of truth. - sitemap.xml (sitemap package) lists every published post plus the static pages only the frontend knows about: home, post list, and the terms documents. - feed.xml (feed package) contains only posts, capped at the 20 most recent. Static pages never appear in the feed. - The backend now exposes, per post, the preview image mime type and size (for a valid RSS enclosure) and the post updated_time. The frontend uses updated_time as sitemap lastmod, while the feed pubDate remains the published time. ## Package Changes | Package | Action | Version | | --- | --- | --- | | feed | Added | 6.0.0 | | sitemap | Added | 9.0.1 | | sanitize-html | Updated | 2.17.3 -> 2.17.7 | No Cargo.toml changes. ## Screenshots N/A (XML endpoints). ## Reference Resolves #117 ## Checklist - [x] A milestone is set - [x] The related issues has been linked to this branch --- Generated by Zed coding agent with Deepseek Flash
squid added this to the 0.8 milestone 2026-09-23 21:21:54 +08:00
squid added the dev/automation label 2026-09-23 21:21:54 +08:00
squid added 9 commits 2026-09-23 21:21:55 +08:00
Author
Owner

Code review(BLOG-117 Auto generate sitemap and RSS file)

整體品質很好,分層清楚(domain / application / adapter / framework 都遵守),用 PostPage + ListPostPagesUseCase 當作公開 URL 的單一來源是個好設計,前端字串也依規範集中到 Strings、重用 Links.RSS。後端用一次批次查詢 get_image_meta_data_by_ids 取代 N+1,值得肯定。

實際跑過的驗證(在 BLOG-117_auto_gen_sitemap_and_rss 上):

檢查 結果
SQLX_OFFLINE=true cargo check -p post -p image@0.7.0 -p server ✅ 通過
cargo test -p post -p image@0.7.0 --lib ✅ 3 passed(含新增的 test_extract_preview_image_id_only)
bun run check(svelte-check) ✅ 0 errors / 0 warnings
bun run lint(prettier + eslint) ✅ 通過
cargo clippy / cargo fmt --check ✅ 變更檔未引入新警告(僅既有雜訊在 search、configuration/embedding.rs)

另外確認:post.updated_time 欄位存在且有 trigger;建置產物 build/server/chunks/* 已把 feed/sitemap 打包進去(放在 devDependencies、runner 只複製 production node_modules 沒問題);RSS <enclosure> 的 type/length 確實會採用我們提供的值(feed 的 RSS2 formatEnclosure 會用 ...enclosure 覆蓋預設值),且 GET /image/{id} 公開且原樣回傳檔案,length 與實際位元組一致。


🟡 需要處理 / 確認(Important)

1. 圖片檔案遺失會讓「文章列表 + sitemap + feed + 圖片管理」整批 500

backend/feature/image/src/adapter/gateway/image_repository_impl.rs 的 to_image_meta_data 現在對每筆 metadata 都呼叫 self.image_storage.size(id)?,而 size() 用 fs::metadata(...),檔案不存在就回 Err。這個路徑被 list_image_meta_data、get_image_meta_data_by_id 以及新增的 get_image_meta_data_by_ids 共用;後者又經由 get_all_post_info_use_case 的 attach_preview_image_metadata 進到 get_all_post_info。結果是只要任何一張 DB 有紀錄(deleted_time IS NULL)但磁碟檔案不存在的圖片,就會讓 GET /image、GET /image/{id}/info、GET /post、/sitemap.xml、/feed.xml 整體回 500。改動前文章列表完全不碰 storage 層,所以這是新引進的單點失效(volume 被清、還原不全、手動改 DB 都可能觸發)。

建議讓單一 size() 失敗不致命,例如 size().ok()(拿不到就略過 enrichment),至少讓列表 / sitemap / feed 不會因一張壞圖全掛。

2. guid 變了,會讓既有訂閱者把所有文章當成新品重現

舊的 script/toolbox/generate_rss.py 用 guid isPermaLink="false">{semantic_id}</guid;新的 frontend/src/lib/seo/framework/xml/feedDocument.ts 設 id: page.url.href,而 feed 的 RSS2 會把 id 當成 guid。也就是 guid 從 semantic-id 變成完整 URL。RSS 讀者以 guid 判斷項目身分,這個變更會讓所有既有文章在讀者端變成未讀新項目(Footer 早已掛 Links.RSS,既有訂閱者存在)。若不是你想要的,請把 guid 固定成 semantic id,只讓 link 改變。

3. 舊的 toolbox 產生器沒被移除,形成雙重來源

PR 描述說取代 manual/toolbox script,但 script/toolbox/generate_rss.py、已提交的 script/toolbox/feed.xml、README.md、.env、Containerfile 都還在,deployment.yaml 也仍會 build/push toolbox image,README 現在與新設計互相矛盾。建議在本 PR 或另開 issue 清掉這條路徑。


🟢 建議 / nit

  • API 欄位不對稱:GET /post(列表)會回 preview_image_mime_type/size,但 GET /post/{id}(詳情,走 GetFullPostUseCaseImpl)永遠是 null。建議在 DTO 註記「僅列表端填入」。
  • Regex 每次重新編譯:ImageExtractor::image_regex() 每次呼叫都 Regex::new().unwrap(),而 attach_preview_image_metadata 對每篇文章呼叫 extract_preview_image_id 兩次。可考慮 std::sync::OnceLock<Regex>。
  • enrichment 時機:attach_preview_image_metadata 對每次 get_all_post_info 都執行(含 keyword 搜尋路徑,之後才篩掉結果),每次列表多一個查詢 + N 次 fs::metadata。可只在 feed/sitemap 路徑做,或加旗標。
  • image_ids 未去重:收集成 Vec 可能有重複 id(= ANY 無害);用 HashSet 較乾淨。
  • robots.txt 未指向 sitemap:可加 Sitemap: <APP_BASE_URL>/sitemap.xml。
  • feedDocument.ts 同時設 date 與 published:RSS2 只有 published 決定 pubDate,date 實際沒作用。
  • 非受管圖片不會有 enclosure:若 preview_image_url 是外部 URL(非 .../image/{id}),extract_preview_image_id 回 None 就不產生 enclosure(行為與舊 toolbox 不同)。
  • 夾帶的無關變更:刪 .vscode/settings.json、sqlx UPDATE 空白調整(導致 .sqlx 快取檔改名)、sanitize-html patch 升版。都無害,但增加 review 噪音。

結論

沒有發現真正的邏輯 bug,程式碼品質與測試都到位。傾向 Request changes,主要卡在第 1、2 點(圖片檔案遺失的失效模式、guid 變更),第 3 點建議順手清掉或明確列為 follow-up,其餘為非阻擋性建議。

補充:CI 目前只有 frontend-ci / pr-title-check,這支 PR 的 Rust 變更在 CI 並沒有被編譯(我是用 SQLX_OFFLINE 在本機驗證可編譯、測試可過)。建議替後端也加一個 CI job。


Generated by Zed coding agent with Deepseek Flash

## Code review(BLOG-117 Auto generate sitemap and RSS file) 整體品質很好,分層清楚(domain / application / adapter / framework 都遵守),用 `PostPage` + `ListPostPagesUseCase` 當作公開 URL 的單一來源是個好設計,前端字串也依規範集中到 `Strings`、重用 `Links.RSS`。後端用一次批次查詢 `get_image_meta_data_by_ids` 取代 N+1,值得肯定。 **實際跑過的驗證**(在 `BLOG-117_auto_gen_sitemap_and_rss` 上): | 檢查 | 結果 | |---|---| | `SQLX_OFFLINE=true cargo check -p post -p image@0.7.0 -p server` | ✅ 通過 | | `cargo test -p post -p image@0.7.0 --lib` | ✅ 3 passed(含新增的 `test_extract_preview_image_id_only`)| | `bun run check`(svelte-check) | ✅ 0 errors / 0 warnings | | `bun run lint`(prettier + eslint) | ✅ 通過 | | `cargo clippy` / `cargo fmt --check` | ✅ 變更檔未引入新警告(僅既有雜訊在 `search`、`configuration/embedding.rs`)| 另外確認:`post.updated_time` 欄位存在且有 trigger;建置產物 `build/server/chunks/*` 已把 `feed`/`sitemap` 打包進去(放在 `devDependencies`、runner 只複製 production `node_modules` 沒問題);RSS `<enclosure>` 的 `type`/`length` 確實會採用我們提供的值(`feed` 的 RSS2 `formatEnclosure` 會用 `...enclosure` 覆蓋預設值),且 `GET /image/{id}` 公開且原樣回傳檔案,`length` 與實際位元組一致。 --- ### 🟡 需要處理 / 確認(Important) **1. 圖片檔案遺失會讓「文章列表 + sitemap + feed + 圖片管理」整批 500** `backend/feature/image/src/adapter/gateway/image_repository_impl.rs` 的 `to_image_meta_data` 現在對每筆 metadata 都呼叫 `self.image_storage.size(id)?`,而 `size()` 用 `fs::metadata(...)`,檔案不存在就回 `Err`。這個路徑被 `list_image_meta_data`、`get_image_meta_data_by_id` 以及新增的 `get_image_meta_data_by_ids` 共用;後者又經由 `get_all_post_info_use_case` 的 `attach_preview_image_metadata` 進到 `get_all_post_info`。結果是只要**任何一張** DB 有紀錄(`deleted_time IS NULL`)但磁碟檔案不存在的圖片,就會讓 `GET /image`、`GET /image/{id}/info`、`GET /post`、`/sitemap.xml`、`/feed.xml` 整體回 500。改動前文章列表完全不碰 storage 層,所以這是新引進的單點失效(volume 被清、還原不全、手動改 DB 都可能觸發)。 建議讓單一 `size()` 失敗不致命,例如 `size().ok()`(拿不到就略過 enrichment),至少讓列表 / sitemap / feed 不會因一張壞圖全掛。 **2. `guid` 變了,會讓既有訂閱者把所有文章當成新品重現** 舊的 `script/toolbox/generate_rss.py` 用 `guid isPermaLink="false">{semantic_id}</guid`;新的 `frontend/src/lib/seo/framework/xml/feedDocument.ts` 設 `id: page.url.href`,而 `feed` 的 RSS2 會把 `id` 當成 `guid`。也就是 guid 從 semantic-id 變成完整 URL。RSS 讀者以 guid 判斷項目身分,這個變更會讓所有既有文章在讀者端變成未讀新項目(Footer 早已掛 `Links.RSS`,既有訂閱者存在)。若不是你想要的,請把 guid 固定成 semantic id,只讓 `link` 改變。 **3. 舊的 toolbox 產生器沒被移除,形成雙重來源** PR 描述說取代 manual/toolbox script,但 `script/toolbox/generate_rss.py`、已提交的 `script/toolbox/feed.xml`、`README.md`、`.env`、`Containerfile` 都還在,`deployment.yaml` 也仍會 build/push toolbox image,README 現在與新設計互相矛盾。建議在本 PR 或另開 issue 清掉這條路徑。 --- ### 🟢 建議 / nit - **API 欄位不對稱**:`GET /post`(列表)會回 `preview_image_mime_type`/`size`,但 `GET /post/{id}`(詳情,走 `GetFullPostUseCaseImpl`)永遠是 `null`。建議在 DTO 註記「僅列表端填入」。 - **`Regex` 每次重新編譯**:`ImageExtractor::image_regex()` 每次呼叫都 `Regex::new().unwrap()`,而 `attach_preview_image_metadata` 對每篇文章呼叫 `extract_preview_image_id` 兩次。可考慮 `std::sync::OnceLock<Regex>`。 - **enrichment 時機**:`attach_preview_image_metadata` 對每次 `get_all_post_info` 都執行(含 keyword 搜尋路徑,之後才篩掉結果),每次列表多一個查詢 + N 次 `fs::metadata`。可只在 feed/sitemap 路徑做,或加旗標。 - **`image_ids` 未去重**:收集成 `Vec` 可能有重複 id(`= ANY` 無害);用 `HashSet` 較乾淨。 - **`robots.txt` 未指向 sitemap**:可加 `Sitemap: <APP_BASE_URL>/sitemap.xml`。 - **`feedDocument.ts` 同時設 `date` 與 `published`**:RSS2 只有 `published` 決定 `pubDate`,`date` 實際沒作用。 - **非受管圖片不會有 enclosure**:若 `preview_image_url` 是外部 URL(非 `.../image/{id}`),`extract_preview_image_id` 回 `None` 就不產生 enclosure(行為與舊 toolbox 不同)。 - **夾帶的無關變更**:刪 `.vscode/settings.json`、sqlx UPDATE 空白調整(導致 `.sqlx` 快取檔改名)、`sanitize-html` patch 升版。都無害,但增加 review 噪音。 --- ### 結論 沒有發現真正的邏輯 bug,程式碼品質與測試都到位。傾向 **Request changes**,主要卡在第 1、2 點(圖片檔案遺失的失效模式、guid 變更),第 3 點建議順手清掉或明確列為 follow-up,其餘為非阻擋性建議。 補充:CI 目前只有 `frontend-ci` / `pr-title-check`,這支 PR 的 Rust 變更在 CI 並沒有被編譯(我是用 `SQLX_OFFLINE` 在本機驗證可編譯、測試可過)。建議替後端也加一個 CI job。 --- Generated by Zed coding agent with Deepseek Flash
squid added 1 commit 2026-09-23 21:47:19 +08:00
NO-ISSUE chore: cargo clippy check
PR Title Check / pr-title-check (pull_request) Successful in 7h59m59s
Frontend CI / build (push) Successful in 9m34s
437506e3ae
squid added 5 commits 2026-09-23 22:04:38 +08:00
The frontend now serves sitemap.xml and feed.xml, so the toolbox container that generated feed.xml is no longer needed. Drop its deployment build step and document the new frontend endpoints in frontend/README.md.
BLOG-117 add: sitemap directive to robots.txt
PR Title Check / pr-title-check (pull_request) Successful in 8h0m0s
Frontend CI / build (push) Successful in 10m2s
3321cd439a
squid added 2 commits 2026-09-23 22:10:57 +08:00
BLOG-117 update: cache the image extractor regexes
PR Title Check / pr-title-check (pull_request) Successful in 18s
Frontend CI / build (push) Successful in 11m31s
92864286dd
Author
Owner

逐條回覆 code review(BLOG-117 Auto generate sitemap and RSS file)

感謝 review。以下逐條對應「在哪個 commit 修復」,commit 皆在 BLOG-117_auto_gen_sitemap_and_rss 分支上。

🟡 需要處理 / 確認

Review 項目 修復
1. 圖片檔案遺失會讓「文章列表 + sitemap + feed + 圖片管理」整批 500 2f6c70d BLOG-117 fix: tolerate missing image files when reading metadata
ImageMetaData.size 改為 Option<i64>,to_image_meta_data 改用 self.image_storage.size(id).ok(),get_image_meta_data_by_id 也跟著回傳 Ok(...)。單一 size() 失敗不再致命,壞圖只會讓自身 size 為 null(GET /image、GET /image/{id}/info、/post、/sitemap.xml、/feed.xml 都不再 500)。
2. guid 從 semantic id 變成完整 URL,既有訂閱者會把舊文重現 ad9206d BLOG-117 fix: use the semantic id as the feed guid
PostPage 新增 semanticId,feed 改設 guid: page.semanticId(feed 會輸出 <guid isPermaLink="false">,與舊 toolbox 的 {semantic_id} 一致),link 仍為完整 URL,符合「只讓 link 改變」。
3. 舊 toolbox 產生器未移除,形成雙重來源 b409c4e BLOG-117 remove: retire the toolbox rss generator
刪除整個 script/toolbox/(Containerfile、generate_rss.py、README.md、.env.example、requirements.txt、.gitignore)與 deployment.yaml 的 Toolbox build/push step,並在 frontend/README.md 補上新的 sitemap / feed 說明。
補充:repo 內並沒有被 git 追蹤的 script/toolbox/feed.xml(從來沒進版控),應該是本機被 .gitignore 忽略的產物。

🟢 建議 / nit

Review 項目 處理
API 欄位不對稱(GET /post/{id}、走 GetFullPostUseCaseImpl 的 preview_image_* 永遠 null) ✅ 573b673 BLOG-117 fix: return preview image metadata from the post detail response
把 enrichment 抽成 PreviewImageMetadataService,list 與 detail 共用;GetFullPostUseCaseImpl 也套用。連帶修好 GET /post/{semanticId} 與 create / update 的回傳。
Regex 每次重新編譯 ✅ 9286428 BLOG-117 update: cache the image extractor regexes
用 std::sync::LazyLock<Regex> 快取(IMAGE_REGEX,以及 extract_image_ids 內原本每次 Regex::new() 的 markdown regex);attach 也改成每篇只解析 image id 一次,不再呼叫兩次。
robots.txt 未指向 sitemap ⚠️ 部分 3321cd4 BLOG-117 add: sitemap directive to robots.txt
已加上 Sitemap: /sitemap.xml,但用的是相對路徑而非建議的 <APP_BASE_URL>/sitemap.xml:robots.txt 是 static/ 下的靜態檔,取不到 PUBLIC_APP_BASE_URL。若要照建議用絕對 URL,得改成 +server.ts route 動態產生(或 hardcode production origin)。這點想先確認要走哪個方向。
enrichment 時機(每次 get_all_post_info 都做,keyword 搜尋路徑之後才篩掉) ⏳ 未處理,列為 follow-up。
image_ids 未去重 ⏳ 未處理(刻意維持原本 Vec 行為,= ANY 無害);要改 HashSet 隨時可以。
feedDocument.ts 同時設 date 與 published ℹ️ 不改:date 是 feed 的 Item 型別必填欄位(供 Atom / JSON 輸出使用),RSS2 的 pubDate 由 published 覆蓋,因此沒有多餘行為。
非受管圖片不會有 enclosure ⏳ 已知行為差異,未處理:外部 preview_image_url(非 .../image/{id})沒有 DB 的 mime / size,就不產生 enclosure;舊 toolbox 是對該 URL 發 HEAD 取得。若要一致需另外設計。
夾帶的無關變更(.vscode / sqlx 空白 / sanitize-html) ℹ️ 皆在 PR 範圍內:.vscode/settings.json 刪除為 10a9d24、.sqlx 快取檔改名來自 9248643(UPDATE query 空白調整)、sanitize-html patch 升版為 9a98d64。如要縮小 PR 可另外拆出。

補充:後端 CI

目前 workflows 只有 deployment.yaml、frontend-ci.yaml、pr-title-check.yaml,這支 PR 的 Rust 變更在 CI 並沒有被編譯。⏳ 未處理,建議另開 issue(或在本 PR 追加一個 backend CI job)。

上述修改都已在本機驗證:SQLX_OFFLINE=true cargo check / cargo clippy --all-targets / cargo test,以及 bun run format / lint / check / build 全部通過。


Generated by Zed coding agent with Deepseek Flash

## 逐條回覆 code review(BLOG-117 Auto generate sitemap and RSS file) 感謝 review。以下逐條對應「在哪個 commit 修復」,commit 皆在 `BLOG-117_auto_gen_sitemap_and_rss` 分支上。 ### 🟡 需要處理 / 確認 | Review 項目 | 修復 | | --- | --- | | **1. 圖片檔案遺失會讓「文章列表 + sitemap + feed + 圖片管理」整批 500** | [`2f6c70d`](https://git.squidspirit.com/squid/blog/commit/2f6c70deaef6273095e6105c0e03c2bae1e1a5f7) `BLOG-117 fix: tolerate missing image files when reading metadata`<br>`ImageMetaData.size` 改為 `Option<i64>`,`to_image_meta_data` 改用 `self.image_storage.size(id).ok()`,`get_image_meta_data_by_id` 也跟著回傳 `Ok(...)`。單一 `size()` 失敗不再致命,壞圖只會讓自身 `size` 為 `null`(`GET /image`、`GET /image/{id}/info`、`/post`、`/sitemap.xml`、`/feed.xml` 都不再 500)。 | | **2. `guid` 從 semantic id 變成完整 URL,既有訂閱者會把舊文重現** | [`ad9206d`](https://git.squidspirit.com/squid/blog/commit/ad9206dfb28f5e25c6222f164250b7f21061c6af) `BLOG-117 fix: use the semantic id as the feed guid`<br>`PostPage` 新增 `semanticId`,feed 改設 `guid: page.semanticId`(`feed` 會輸出 `<guid isPermaLink="false">`,與舊 toolbox 的 `{semantic_id}` 一致),`link` 仍為完整 URL,符合「只讓 link 改變」。 | | **3. 舊 toolbox 產生器未移除,形成雙重來源** | [`b409c4e`](https://git.squidspirit.com/squid/blog/commit/b409c4e2e1decde2b46d86df146fdc09ad7b8c8f) `BLOG-117 remove: retire the toolbox rss generator`<br>刪除整個 `script/toolbox/`(`Containerfile`、`generate_rss.py`、`README.md`、`.env.example`、`requirements.txt`、`.gitignore`)與 `deployment.yaml` 的 Toolbox build/push step,並在 `frontend/README.md` 補上新的 sitemap / feed 說明。<br>補充:repo 內並沒有被 git 追蹤的 `script/toolbox/feed.xml`(從來沒進版控),應該是本機被 `.gitignore` 忽略的產物。 | ### 🟢 建議 / nit | Review 項目 | 處理 | | --- | --- | | API 欄位不對稱(`GET /post/{id}`、走 `GetFullPostUseCaseImpl` 的 `preview_image_*` 永遠 `null`) | ✅ [`573b673`](https://git.squidspirit.com/squid/blog/commit/573b67341e31dc84db024635b5e4369af8b4e9b0) `BLOG-117 fix: return preview image metadata from the post detail response`<br>把 enrichment 抽成 `PreviewImageMetadataService`,list 與 detail 共用;`GetFullPostUseCaseImpl` 也套用。連帶修好 `GET /post/{semanticId}` 與 create / update 的回傳。 | | `Regex` 每次重新編譯 | ✅ [`9286428`](https://git.squidspirit.com/squid/blog/commit/92864286dd9caf647835ede0c49fe0065b4fe409) `BLOG-117 update: cache the image extractor regexes`<br>用 `std::sync::LazyLock<Regex>` 快取(`IMAGE_REGEX`,以及 `extract_image_ids` 內原本每次 `Regex::new()` 的 markdown regex);`attach` 也改成每篇只解析 image id 一次,不再呼叫兩次。 | | `robots.txt` 未指向 sitemap | ⚠️ 部分 [`3321cd4`](https://git.squidspirit.com/squid/blog/commit/3321cd439ac00c8fb24d64fd132bc2ca23e7c561) `BLOG-117 add: sitemap directive to robots.txt`<br>已加上 `Sitemap: /sitemap.xml`,但用的是**相對路徑**而非建議的 `<APP_BASE_URL>/sitemap.xml`:`robots.txt` 是 `static/` 下的靜態檔,取不到 `PUBLIC_APP_BASE_URL`。若要照建議用絕對 URL,得改成 `+server.ts` route 動態產生(或 hardcode production origin)。這點想先確認要走哪個方向。 | | enrichment 時機(每次 `get_all_post_info` 都做,keyword 搜尋路徑之後才篩掉) | ⏳ 未處理,列為 follow-up。 | | `image_ids` 未去重 | ⏳ 未處理(刻意維持原本 `Vec` 行為,`= ANY` 無害);要改 `HashSet` 隨時可以。 | | `feedDocument.ts` 同時設 `date` 與 `published` | ℹ️ 不改:`date` 是 `feed` 的 `Item` 型別**必填**欄位(供 Atom / JSON 輸出使用),RSS2 的 `pubDate` 由 `published` 覆蓋,因此沒有多餘行為。 | | 非受管圖片不會有 enclosure | ⏳ 已知行為差異,未處理:外部 `preview_image_url`(非 `.../image/{id}`)沒有 DB 的 mime / size,就不產生 enclosure;舊 toolbox 是對該 URL 發 HEAD 取得。若要一致需另外設計。 | | 夾帶的無關變更(`.vscode` / sqlx 空白 / `sanitize-html`) | ℹ️ 皆在 PR 範圍內:`.vscode/settings.json` 刪除為 [`10a9d24`](https://git.squidspirit.com/squid/blog/commit/10a9d24ecc7f336019ae8b8deb0c9a69416c523f)、`.sqlx` 快取檔改名來自 [`9248643`](https://git.squidspirit.com/squid/blog/commit/9248643f500808637d10400f651538d9105f1d2a)(UPDATE query 空白調整)、`sanitize-html` patch 升版為 [`9a98d64`](https://git.squidspirit.com/squid/blog/commit/9a98d64b6481e90dd064258021ff211124c5e7af)。如要縮小 PR 可另外拆出。 | ### 補充:後端 CI 目前 workflows 只有 `deployment.yaml`、`frontend-ci.yaml`、`pr-title-check.yaml`,這支 PR 的 Rust 變更在 CI 並沒有被編譯。⏳ 未處理,建議另開 issue(或在本 PR 追加一個 backend CI job)。 上述修改都已在本機驗證:`SQLX_OFFLINE=true cargo check / cargo clippy --all-targets / cargo test`,以及 `bun run format / lint / check / build` 全部通過。 --- Generated by Zed coding agent with Deepseek Flash
squid scheduled this pull request to auto merge when all checks succeed 2026-09-23 22:16:52 +08:00
squid merged commit 573d0265f8 into main 2026-09-23 22:39:43 +08:00
squid deleted branch BLOG-117_auto_gen_sitemap_and_rss 2026-09-23 22:39:43 +08:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: squid/blog#303