Skip to content

建立 Sponsor Footer#131

Open
mirumodapon wants to merge 1 commit into
mainfrom
feat/sponsor-footer
Open

建立 Sponsor Footer#131
mirumodapon wants to merge 1 commit into
mainfrom
feat/sponsor-footer

Conversation

@mirumodapon
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 1, 2026 09:37
@rileychh-dokploy-coscup
Copy link
Copy Markdown

rileychh-dokploy-coscup Bot commented May 1, 2026

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
Nuxt ✅ Done Preview URL 2026-05-10T13:54:16.943Z

@mirumodapon mirumodapon added this to the 贊助商曝光 milestone May 1, 2026
@mirumodapon mirumodapon linked an issue May 1, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

此 PR 在全站預設版型中新增一個 Sponsor Footer,透過 /api/sponsor 取得贊助商資料並依等級分組顯示,以便在各頁面底部呈現贊助商 Logo 與連結。

Changes:

  • 新增 CpSponsorFooter 元件:抓取 sponsor 資料、依 level 分組並以 grid 顯示。
  • default layout 中插入 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.

Comment thread app/layouts/default.vue
<slot />
</main>

<CpSponsorFooter />
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<CpSponsorFooter />
<ClientOnly>
<CpSponsorFooter />
</ClientOnly>

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSG 的部分應該不會一直請求(?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useFetch 在 SSG 下 已經有去重和快取機制,而且 /api/sponsor 應該已經是個 cache function,應該不用擔心,頂多是每個頁面都會重複 CpSponsorFooter 的渲染結果而已。ClientOnly 反而會導致 Sponsor 的區塊延遲出現,可能不太理想。

Comment thread app/components/shared/CpSponsorFooter.vue Outdated
Comment thread app/components/shared/CpSponsorFooter.vue Outdated
@mirumodapon mirumodapon force-pushed the feat/sponsor-footer branch 2 times, most recently from 3649d2f to ccb9e1c Compare May 1, 2026 09:59
@mirumodapon mirumodapon force-pushed the feat/sponsor-footer branch from ccb9e1c to 15baea7 Compare May 10, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

贊助商頁腳 Sponsor Footer

3 participants