今日完工 10 commit 18條教訓 遊戲間v3.5 CSP修復 重構計畫
v11.12 補充包 2026-10-21 下午

今日完工總表(2026-10-21)

類別項目Commit
雙機同步Lenovo clone ahpal-pet、切 main、預設分支改 main、刪舊 master—
.gitignore18 診斷腳本忽略、部署腳本保留65fd5ca / 3f87252 / cc733bc
strategy 連結12 檔、33 連結修復(11 個 404 全 200)a62e1998
交接手冊v11.11(15 條血淚教訓、網頁複製框解法)7699ab60
寵物系統交接總覽v2.3 MD(5,204 字元、7 章)ab9309f7
遊戲間 v3.5導覽列 10 連結、頁尾四大區塊a907968f
遊戲頁面 CSS載入 /style/main.css0b46a21f
Footer 修復一長條 正常四欄ba337647
CSP 放行 Giscusscript-src / style-src / frame-src 全放行f7227acb
CSP connect-src改為 ahpal-pet-d1be51e7db

18 條血淚教訓(15 條沿用 v11.11 + 3 條新增)

16. 遊戲頁面載入 main.css 後,body display:flex 會把 footer 壓成一長條

解法:遊戲頁面 style 加 body{display:block !important;} 與 .site-footer{width:100% !important;background:#2D3748 !important;}

17. Giscus 需要 script-src、style-src、frame-src 三個都放行 giscus.app

只放行 script-src 不夠,iframe 與 CSS 會被擋,留言框空白。解法:_headers 三個指令全加 https://giscus.app

18. Giscus 的 404 Discussion not found 是正常現象

沒人留言過的頁面,第一次查詢會 404,第一次留言才建立 Discussion。不是錯誤。

前 15 條見 v11.11 第 4 章。

遊戲間 v3.5(2026-10-21 完成)

完成項目

項目Commit
導覽列 10 連結、頁尾四大區塊a907968f
遊戲頁面載入 /style/main.css0b46a21f
Footer 一長條修復ba337647
CSP 放行 giscus.appf7227acb
CSP connect-src 改為 ahpal-pet-d1be51e7db

現況

CSP 修復完整記錄

_headers 現況(500 bytes)

/sitemap.xml → Content-Type: application/xml; charset=utf-8

/* → Content-Security-Policy: default-src self; connect-src self https://ahpal-pet-d1.praystone.workers.dev; script-src self unsafe-inline pagead2.googlesyndication.com googletagmanager.com giscus.app static.cloudflareinsights.com; style-src self unsafe-inline giscus.app; frame-src self giscus.app; img-src self data: https:; font-src self; frame-ancestors none

修復過程

  1. Console 出現 Refused to load giscus.app/client.js(CSP 擋)
  2. script-src 加 giscus.app
  3. style-src 加 giscus.app
  4. frame-src 加 giscus.app
  5. connect-src 從 ahpal-pet-api 改為 ahpal-pet-d1

雙機同步修復記錄

Lenovo 主機問題

.gitignore 整理

strategy 33 連結修復記錄

11 個 404 修復清單

錯誤連結正確連結
/announcement//strategy/
/wall.htmlhttps://pet.ahpal.com/wall.html
/style.css/style/main.css
ahpal.com/history/denounce-google-adsense-path.htmlwww.ahpal.com/history/denounce-google-adsense.html
www.ahpal.com/fiction/steel-production-line.htmlwww.ahpal.com/strategy/steel-production-line.html
www.ahpal.com/pet/project-plan.htmlwww.ahpal.com/strategy/ahpal-pet-Project-Plan.html
www.ahpal.com/whitepaper/cyber-spring-autumn.htmlwww.ahpal.com/strategy/Cyber-Spring-Autumn.html
www.ahpal.com/history/cyber-spring-autumn-whitepaper.htmlwww.ahpal.com/strategy/Cyber-Spring-Autumn.html
www.ahpal.com/reports/youtube-analytics/www.ahpal.com/strategy/youtube-report-20261007-102723.html
www.ahpal.com/announcement/veterans-return.htmlwww.ahpal.com/strategy/letter-to-members-2026.html
memories.ahpal.com/bbs2/bbs2.ahpal.com/

遊戲間重構計畫(待執行)

現況問題

重構目標(三層拆分)

  1. 第一層:game/games.json(23 款遊戲 metadata)
  2. 第二層:game/template.html(Header/Footer/head/Giscus)
  3. 第三層:scripts/generate-games.ps1(精簡版,< 200 行)

預期效益

優先順序

低(目前無立即風險,24 頁全部正常)。建議排進下一個大任務。