feat: add fringe events page and API#186
Conversation
Dokploy Preview Deployment
|
mirumodapon
left a comment
There was a problem hiding this comment.
我在思考如果 CpContentCard.vue 在贊助頁面與 Fringe 的頁面沒有其他改動的話,應該可以不用 CpFringeCard.vue 或是 CpSponsorCard.vue ,直接引用就可以了。
| intro_zh: z.string(), | ||
| intro_en: z.string(), | ||
| link: z.string(), | ||
| contact: z.string(), |
There was a problem hiding this comment.
或許可以想想怎麼把 contact 的資訊呈現出來
There was a problem hiding this comment.
想確認一下 contact 欄位是什麼意思呢? 是聯絡人嗎?
|
|
||
| <i18n lang="yaml"> | ||
| zh: | ||
| noFringe: "周邊活動目前尚未公布。" |
There was a problem hiding this comment.
這個文字我等等去大籌上問問,可能會需要像是:「如果有你有活動,可以到....申請」
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c41a23ee8d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const { t } = useI18n() | ||
|
|
||
| const { data: fringes } = await useFetch<Fringe[]>('/api/fringe') |
There was a problem hiding this comment.
Ensure the new page is prerendered
When this page is only added as a filesystem route, it is not discoverable by the static-generation crawler: I checked app/components/shared/CpNavbar.vue, app/components/shared/CpFooter.vue, nuxt.config.ts, and app/app.vue, and there is no link or prerenderRoutes entry for /fringe (only these new fringe files reference it). Nuxt's prerender docs note that pages not linked from a discoverable page cannot be prerendered automatically, so on the GitHub Pages deployment direct visits to /2026/fringe and /2026/en/fringe will 404 unless this route is linked or explicitly registered for prerendering.
Useful? React with 👍 / 👎.
Changes
/fringe頁面,顯示周邊活動列表/api/fringeserver API,從fringesheet 讀取資料,並在 production 過濾未 publish 的項目。FringeRow/Fringe型別與 zod schema,並把fringe加入 sheet ID、sheet name 與 schema 對應。CpFringeCard元件,用於轉接周邊活動資料到共用卡片。CpContentCard共用元件,集中處理標題、圖片、介紹文字、外部連結與 read more/show less。CpSponsorCard,改用CpContentCard呈現,移除重複 UI 與 i18n 邏輯。transformGoogleDriveImageUrl,並套用到 sponsor 與 fringe API。Impact
/fringe頁面,贊助商卡片顯示邏輯改由共用元件處理。/api/fringe,並調整/api/sponsor使用共用圖片轉換工具。fringesheet 對應,欄位需符合FringeRowSchema。