建立 Sponsor Footer#131
Conversation
Dokploy Preview Deployment
|
There was a problem hiding this comment.
Pull request overview
此 PR 在全站預設版型中新增一個 Sponsor Footer,透過 /api/sponsor 取得贊助商資料並依等級分組顯示,以便在各頁面底部呈現贊助商 Logo 與連結。
Changes:
- 新增
CpSponsorFooter元件:抓取 sponsor 資料、依 level 分組並以 grid 顯示。 - 在
defaultlayout 中插入CpSponsorFooter,使其在所有使用預設版型的頁面渲染。 - 新增 Sponsor Footer 的 i18n 文案(level 名稱)。
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/layouts/default.vue | 在全站預設 layout 中引入並渲染 CpSponsorFooter。 |
| app/components/shared/CpSponsorFooter.vue | 新增 Sponsor Footer 元件:fetch sponsor、分組、渲染 sponsor links + images。 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <slot /> | ||
| </main> | ||
|
|
||
| <CpSponsorFooter /> |
There was a problem hiding this comment.
Including CpSponsorFooter in the default layout means every page render/prerender will trigger its data fetch. Since /api/sponsor ultimately hits Google Sheets (fetchSheet('sponsorList')), this can noticeably slow nuxt generate and increase the chance of rate limiting. Consider adding caching (e.g., Nitro cachedEventHandler/storage) or making the footer fetch lazy/client-side so it doesn’t block all routes during prerender.
| <CpSponsorFooter /> | |
| <ClientOnly> | |
| <CpSponsorFooter /> | |
| </ClientOnly> |
There was a problem hiding this comment.
SSG 的部分應該不會一直請求(?)
There was a problem hiding this comment.
useFetch 在 SSG 下 已經有去重和快取機制,而且 /api/sponsor 應該已經是個 cache function,應該不用擔心,頂多是每個頁面都會重複 CpSponsorFooter 的渲染結果而已。ClientOnly 反而會導致 Sponsor 的區塊延遲出現,可能不太理想。
3649d2f to
ccb9e1c
Compare
ccb9e1c to
15baea7
Compare
No description provided.