Skip to content

[next] rewrite docs for slash commands with i18n and command visuals - #317

Open
kane50613 wants to merge 85 commits into
masterfrom
next
Open

[next] rewrite docs for slash commands with i18n and command visuals#317
kane50613 wants to merge 85 commits into
masterfrom
next

Conversation

@kane50613

@kane50613 kane50613 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Why

機器龍在 prisma 分支已經全面改成斜線指令,投票、抽獎、找吃的這些新系統跟舊文件完全對不上,音樂、跨群聊天、舊 RPG 也早就下線了。文件需要整個重寫,順便加上簡體中文。

這是長期開發分支,release 前不會合併。預覽站:https://next.yeecord.com

What

內容

  • 依 bot 現況重寫全部 docs:poll v2(匿名/鎖票/開票保密/權重/匯出)、giveaway、auto-channels、lock-channel、auto-role、role-menu、member-notification、ticket、clear、bot-fight、lol、utility、find-food
  • 刪除已下線功能的頁面(跨群聊天、音樂、舊 RPG、指令參照),slug 跟著新指令名稱改
  • 新增「Discord 新手入門」頁,給沒用過 Discord 的讀者
  • 全部頁面都有簡體中文版(.zh-cn.mdx + meta.zh-cn.json),用語在地化而不是機翻

元件

  • <SlashCommand>:做成 Discord 聊天輸入框的樣子,指令與參數用 pill 呈現
  • <DiscordChat><DiscordMessage><DiscordEmbed><DiscordButton>:模擬機器人回覆,取代過時截圖
  • <Cmd>:內文指令 hover 用 shadcn(Base UI)tooltip 顯示 Discord 內的中文顯示名稱,依語系切換;名稱同步自 bot 的 i18n 檔
  • <RoleOrderDemo><ChannelPermissionDemo>:framer-motion 動畫示範身分組排序跟頻道權限
  • 側欄指令頁右側顯示 /poll 這類 badge
  • shadcn 以 base-nova 樣式接入,token 全部 alias 到 fumadocs 的 fd-* 變數;Discord 色盤集中在 app.css@theme

i18n

  • defineI18n zh-tw(預設)+ zh-cn,語言包 @fumapress/language
  • 走 fumapress 原生的全前綴路由:/zh-tw/*/zh-cn/*,不用任何 patch
  • 舊的無前綴網址在 public/_redirects 301 到 /zh-tw/*:docs 可 blanket(孤兒截圖已刪),blog 因作者頭像同住 /blog/ 下逐篇列
  • 每頁輸出 canonical + hreflang(zh-Hantzh-Hansx-default
  • 自製 search plugin 掛 mandarin tokenizer(上游 plugin 沒開放 localeMap,中文語系會讓 Orama 直接炸掉)
  • 補回 i18n 模式下消失的根目錄 404 頁;首頁維持在 /

Notes

  • 首頁行銷區塊(RPG、音樂)內容還是舊的,之後再處理
  • MDX 內文還有些 /docs/... 站內連結靠 301 過渡,之後可改成前綴直達
  • yeecord repo 的 zh-CN i18n 檔裡 slash.auto_channels.name 是繁體字,bot 那邊可以順手修

Gate:bun run typecheck ✅、bun run build ✅(650 檔案),dev 各語系路由 200。

Summary by CodeRabbit

  • 新功能

    • 新增繁體中文與簡體中文文件,涵蓋快速入門、指令總覽、投票、抽獎、動態語音、頻道鎖定、身分組管理、實用工具與《找吃的》遊戲。
    • 新增文件中的 Discord 介面示範、互動提示與指令權限說明。
    • 支援文件搜尋與多語系導覽。
  • 文件更新

    • 更新 FAQ、貢獻指南與本機開發說明。
    • 移除已退役的舊指令、跨群聊天與 RPG 文件。
  • 改善

    • 整理舊網址、文件、部落格與條款頁面的重新導向。
    • 更新 Logo 顯示與網站連結。

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 88a1a0e
Status: ✅  Deploy successful!
Preview URL: https://962d4f47.website-bmk.pages.dev
Branch Preview URL: https://next.website-bmk.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

本次變更重構雙語文件內容,新增 Discord/MDX 展示元件與互動示範,並整合多語系佈局、搜尋、SEO、導覽、主題樣式、資源轉址及本機開發指南。

Changes

文件內容與指令指南

Layer / File(s) Summary
雙語入門與功能文件
content/docs/basics*, content/docs/index*, content/docs/find-food*, content/docs/faq*
新增 Discord 入門、找吃的、FAQ 與新版文件首頁,並更新文件目錄。
雙語指令文件
content/docs/commands/*
新增或改寫投票、抽獎、動態語音、角色、清理、保護、工具等指令文件與目錄。
貢獻與本機開發指南
content/docs/contribute/*
改用 Bun、fumapress 與 Waku 說明本機預覽、建置檢查及文件投稿規範。

平台與呈現元件

Layer / File(s) Summary
Discord MDX 元件與互動示範
src/components/mdx/*, src/components/ui/tooltip.tsx, src/app.css, components.json, package.json
新增 SlashCommand、Discord 聊天、Embed、按鈕、Tooltip、角色順序與頻道權限示範元件,並加入對應樣式與依賴。
多語系佈局與搜尋
src/root-layout.tsx, src/search-plugin.ts, press.config.tsx, src/pages/*
建立雙語根佈局、靜態頁面與搜尋 API,並更新 MDX 注入、文件樹、指令徽章及 SEO alternate 連結。
導覽、資源與路由遷移
src/layout-config.tsx, src/home/*, src/blog/layouts.tsx, public/_redirects, config.ts, src/components/Footer.tsx, src/og-image.tsx
更新語系路徑、Logo、品牌圖像、首頁連結、部署網域與舊文件、條款、部落格路徑轉址。

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • yeecord/website#316:同樣涉及 fumapress/Bun 遷移、press.config.tsx、i18n、MDX 元件、根佈局與搜尋設定。
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 標題清楚點出此 PR 的核心:重寫 slash commands 文件並加入 i18n 與指令視覺元件。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
src/components/mdx/discord-demo.tsx (1)

92-108: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

移除多餘的 AnimatePresence 包裝。

這裡的 Cell 元件並沒有被條件式渲染(Mount / Unmount),而是常駐在 DOM 中,僅透過 active 屬性來改變 opacity 的動畫效果。因為沒有元件的移除與掛載,外層的 AnimatePresence 無法發揮作用且是多餘的,建議可以將其移除以簡化程式碼。

♻️ 建議的修改
-                <AnimatePresence initial={false}>
-                  <Cell
-                    active={done && !permission.enabled}
-                    className="bg-[`#da373c`]"
-                  >
-                    <X className="size-4" />
-                  </Cell>
-                  <Cell active={!done} className="bg-[`#4e5058`]">
-                    <span className="px-1 text-xs">/</span>
-                  </Cell>
-                  <Cell
-                    active={done && permission.enabled}
-                    className="bg-[`#248046`]"
-                  >
-                    <Check className="size-4" />
-                  </Cell>
-                </AnimatePresence>
+                <Cell
+                  active={done && !permission.enabled}
+                  className="bg-[`#da373c`]"
+                >
+                  <X className="size-4" />
+                </Cell>
+                <Cell active={!done} className="bg-[`#4e5058`]">
+                  <span className="px-1 text-xs">/</span>
+                </Cell>
+                <Cell
+                  active={done && permission.enabled}
+                  className="bg-[`#248046`]"
+                >
+                  <Check className="size-4" />
+                </Cell>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/mdx/discord-demo.tsx` around lines 92 - 108, Remove the
unnecessary AnimatePresence wrapper around the three Cell elements in the
discord demo. Keep all Cell components and their active conditions unchanged,
preserving their opacity-based animation behavior.
content/docs/index.cn.mdx (1)

10-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

使用標準的 JSX 標籤包覆子元素

在 JSX 中直接傳遞 children 屬性(children="邀请机器龙")是不建議的寫法。建議將文字包覆在元件的開關標籤之間,以符合 React 的慣用寫法並提升程式碼的可讀性。

♻️ 建議的重構方式
-<LinkButton
-  href="https://yeecord.com/link"
-  variant="primary"
-  children="邀请机器龙"
-/>
+<LinkButton href="https://yeecord.com/link" variant="primary">
+  邀请机器龙
+</LinkButton>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content/docs/index.cn.mdx` around lines 10 - 14, Update the LinkButton usage
in the documentation to place 邀请机器龙 between the component’s opening and closing
tags instead of passing it through the children prop, while preserving the
existing href and variant values.
content/docs/index.mdx (1)

10-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建議使用 JSX 標籤包覆子元素寫法。

雖然將文字傳入 children 屬性在 React / MDX 中是合法的,但依據 JSX 慣例,將子元素直接包覆在標籤之間會更具可讀性且符合一般習慣。

💡 建議的重構方式
-<LinkButton
-  href="https://yeecord.com/link"
-  variant="primary"
-  children="邀請機器龍"
-/>
+<LinkButton href="https://yeecord.com/link" variant="primary">
+  邀請機器龍
+</LinkButton>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content/docs/index.mdx` around lines 10 - 14, Update the LinkButton usage to
place the invite text as a child between the opening and closing tags instead of
passing it through the children prop, while preserving the existing href and
variant props.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/docs/commands/lock-channel.mdx`:
- Line 19: 修正文檔中的錯字:將 lock-channel 說明文字「看不進去」改為「進不去」,並保留其餘內容不變。

In `@public/_redirects`:
- Around line 16-25: 在 public/_redirects 的既有文件轉址規則中新增 music 相關舊路徑:將 /docs/music
與 /docs/commands/music 以 301 轉址至 /docs 或其他適當的現有頁面,確保兩個舊連結不會回傳 404。

In `@src/search-plugin.ts`:
- Around line 23-46: 在初始化搜索服务器的流程中,先调用并等待 this.getLoader 获取已解析的 source
对象,再将该对象传入 createFromSource;不要直接传递 this.getLoader 函数,并保持现有 localeMap 与
buildIndex 配置不变。

---

Nitpick comments:
In `@content/docs/index.cn.mdx`:
- Around line 10-14: Update the LinkButton usage in the documentation to place
邀请机器龙 between the component’s opening and closing tags instead of passing it
through the children prop, while preserving the existing href and variant
values.

In `@content/docs/index.mdx`:
- Around line 10-14: Update the LinkButton usage to place the invite text as a
child between the opening and closing tags instead of passing it through the
children prop, while preserving the existing href and variant props.

In `@src/components/mdx/discord-demo.tsx`:
- Around line 92-108: Remove the unnecessary AnimatePresence wrapper around the
three Cell elements in the discord demo. Keep all Cell components and their
active conditions unchanged, preserving their opacity-based animation behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c9469d7-d59d-40e0-b945-c0d7cfbbb356

📥 Commits

Reviewing files that changed from the base of the PR and between e63b325 and 718cf43.

📒 Files selected for processing (65)
  • _redirects
  • content/docs/basics.cn.mdx
  • content/docs/basics.mdx
  • content/docs/commands/auto-channels.cn.mdx
  • content/docs/commands/auto-channels.mdx
  • content/docs/commands/bot-fight.cn.mdx
  • content/docs/commands/bot-fight.mdx
  • content/docs/commands/chat.mdx
  • content/docs/commands/clear.cn.mdx
  • content/docs/commands/clear.mdx
  • content/docs/commands/dvc.mdx
  • content/docs/commands/giveaway.cn.mdx
  • content/docs/commands/giveaway.mdx
  • content/docs/commands/index.cn.mdx
  • content/docs/commands/index.mdx
  • content/docs/commands/join-message.mdx
  • content/docs/commands/list.mdx
  • content/docs/commands/lock-channel.cn.mdx
  • content/docs/commands/lock-channel.mdx
  • content/docs/commands/lol.cn.mdx
  • content/docs/commands/lol.mdx
  • content/docs/commands/member-notification.cn.mdx
  • content/docs/commands/member-notification.mdx
  • content/docs/commands/meta.cn.json
  • content/docs/commands/meta.json
  • content/docs/commands/poll.cn.mdx
  • content/docs/commands/poll.mdx
  • content/docs/commands/reference/general.mdx
  • content/docs/commands/reference/index.mdx
  • content/docs/commands/reference/meta.json
  • content/docs/commands/role.cn.mdx
  • content/docs/commands/role.mdx
  • content/docs/commands/ticket.cn.mdx
  • content/docs/commands/ticket.mdx
  • content/docs/commands/utility.cn.mdx
  • content/docs/commands/utility.mdx
  • content/docs/contribute/guide.mdx
  • content/docs/contribute/run-project.mdx
  • content/docs/faq.cn.mdx
  • content/docs/faq.mdx
  • content/docs/find-food.cn.mdx
  • content/docs/find-food.mdx
  • content/docs/index.cn.mdx
  • content/docs/index.mdx
  • content/docs/meta.cn.json
  • content/docs/meta.json
  • content/docs/rpg/index.mdx
  • content/docs/rpg/introduction.mdx
  • content/docs/rpg/jobs.mdx
  • content/docs/rpg/make.mdx
  • content/docs/rpg/meta.json
  • content/docs/rpg/shop.mdx
  • press.config.tsx
  • public/_redirects
  • src/components/mdx/cmd.tsx
  • src/components/mdx/discord-demo.tsx
  • src/components/mdx/discord.tsx
  • src/components/mdx/index.tsx
  • src/default-locale-plugin.tsx
  • src/layout-config.tsx
  • src/pages/404.tsx
  • src/pages/_layout.tsx
  • src/pages/index.tsx
  • src/root-layout.tsx
  • src/search-plugin.ts
💤 Files with no reviewable changes (14)
  • _redirects
  • content/docs/rpg/meta.json
  • content/docs/rpg/shop.mdx
  • content/docs/commands/list.mdx
  • content/docs/rpg/introduction.mdx
  • content/docs/commands/reference/index.mdx
  • content/docs/commands/reference/meta.json
  • content/docs/rpg/index.mdx
  • content/docs/rpg/jobs.mdx
  • content/docs/commands/reference/general.mdx
  • content/docs/commands/chat.mdx
  • content/docs/commands/dvc.mdx
  • content/docs/rpg/make.mdx
  • content/docs/commands/join-message.mdx

Comment thread content/docs/commands/lock-channel.mdx Outdated
Comment thread public/_redirects Outdated
Comment thread src/search-plugin.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
content/docs/index.zh-cn.mdx (1)

10-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建議改用標籤包覆的寫法傳遞 children

在 React 與 MDX 中,直接將 children 作為屬性傳遞(children="...")雖然能夠順利運作,但較不符合常規慣例。建議改用標籤包覆的寫法,以提升代碼的可讀性。

♻️ 建議的重構方式
- <LinkButton
-   href="https://yeecord.com/link"
-   variant="primary"
-   children="邀请机器龙"
- />
+ <LinkButton href="https://yeecord.com/link" variant="primary">
+   邀请机器龙
+ </LinkButton>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content/docs/index.zh-cn.mdx` around lines 10 - 14, Update the LinkButton
usage to pass “邀请机器龙” as nested child content between the opening and closing
tags instead of using the children attribute, while preserving its href and
primary variant.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@content/docs/index.zh-cn.mdx`:
- Around line 10-14: Update the LinkButton usage to pass “邀请机器龙” as nested child
content between the opening and closing tags instead of using the children
attribute, while preserving its href and primary variant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 656eb58e-601c-4508-a3a2-f7cf5eeebd48

📥 Commits

Reviewing files that changed from the base of the PR and between 718cf43 and fe8e470.

📒 Files selected for processing (22)
  • content/docs/basics.zh-cn.mdx
  • content/docs/commands/auto-channels.zh-cn.mdx
  • content/docs/commands/bot-fight.zh-cn.mdx
  • content/docs/commands/clear.zh-cn.mdx
  • content/docs/commands/giveaway.zh-cn.mdx
  • content/docs/commands/index.zh-cn.mdx
  • content/docs/commands/lock-channel.zh-cn.mdx
  • content/docs/commands/lol.zh-cn.mdx
  • content/docs/commands/member-notification.zh-cn.mdx
  • content/docs/commands/meta.zh-cn.json
  • content/docs/commands/poll.zh-cn.mdx
  • content/docs/commands/role.zh-cn.mdx
  • content/docs/commands/ticket.zh-cn.mdx
  • content/docs/commands/utility.zh-cn.mdx
  • content/docs/faq.zh-cn.mdx
  • content/docs/find-food.zh-cn.mdx
  • content/docs/index.zh-cn.mdx
  • content/docs/meta.zh-cn.json
  • press.config.tsx
  • src/layout-config.tsx
  • src/root-layout.tsx
  • src/search-plugin.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/layout-config.tsx
  • src/search-plugin.ts
  • press.config.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/home/Hero.tsx (1)

76-90: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

避免寫死 /zh-tw 語系前綴,以維持多語系導覽體驗。

這些連結寫死了 /zh-tw 前綴。對於 Hero.tsxDashboard.tsx 中指向 docs 的連結,這會導致瀏覽簡體中文版首頁的使用者,在點擊後被強制跳轉回繁體中文版文件,破壞了多語系體驗。

如果對應的頁面(例如部落格與條款)目前僅有繁體中文版,寫死前綴作為避免 404 的過渡方案是可以接受的;但對於已經支援多語系的文件頁面,建議根據當前使用者的語系動態生成連結路徑。

  • src/home/Hero.tsx#L76-L90: 將 /zh-tw/docs 改為動態語系路徑。
  • src/home/features/Dashboard.tsx#L57-L61: 將 /zh-tw/docs/commands/role-menu 改為動態語系路徑。
  • config.ts#L11-L19: 評估頁尾連結是否應支援動態語系。
  • src/blog/layouts.tsx#L98-L104: 評估部落格連結是否應支援動態語系。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/home/Hero.tsx` around lines 76 - 90, 移除 Hero.tsx 76-90 中 docs 連結寫死的
`/zh-tw` 前綴,改用目前使用者語系動態產生路徑;同步更新 src/home/features/Dashboard.tsx 57-61 的
role-menu docs 連結。檢視 config.ts 11-19 的頁尾連結與 src/blog/layouts.tsx 98-104
的部落格連結,僅在對應頁面支援多語系時改為動態語系路徑,若目前僅有繁體中文版則保留現有前綴。
🧹 Nitpick comments (1)
content/docs/commands/auto-role.mdx (1)

20-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

統一內部連結,建議使用相對路徑以避免依賴重新導向。

根據 PR 說明,目前所有的語系路由已移至 /zh-tw/zh-cn。繁體中文文件若使用 /docs/... 將會觸發新舊路徑的重新導向,而簡體中文則是寫死了包含語系前綴的絕對路徑 /zh-cn/docs/...。為確保 SPA 切換順暢並保持雙語文件寫法的一致性,建議統一改為相對路徑(多數文件框架能自動解析 Markdown 相對路徑並補齊正確的語系):

  • content/docs/commands/auto-role.mdx#L20-L24: 將 /docs/basics/#身分組的順序很重要/docs/commands/role-menu/ 改為相對路徑 ../basics/#身分組的順序很重要./role-menu
  • content/docs/commands/auto-role.zh-cn.mdx#L20-L24: 將 /zh-cn/docs/basics/#身份组的顺序很重要/zh-cn/docs/commands/role-menu/ 改為相對路徑 ../basics/#身份组的顺序很重要./role-menu
  • content/docs/commands/role-menu.mdx#L34-L40: 將 /docs/basics/#身分組的順序很重要/docs/commands/auto-role/ 改為相對路徑 ../basics/#身分組的順序很重要./auto-role
  • content/docs/commands/role-menu.zh-cn.mdx#L34-L40: 將 /zh-cn/docs/basics/#身份组的顺序很重要/zh-cn/docs/commands/auto-role/ 改為相對路徑 ../basics/#身份组的顺序很重要./auto-role
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content/docs/commands/auto-role.mdx` around lines 20 - 24,
統一四個文件中的內部連結為相對路徑:在 content/docs/commands/auto-role.mdx 第20-24行與
content/docs/commands/role-menu.mdx 第34-40行,移除 /docs 前綴並分別改用
../basics/#身分組的順序很重要 與同層的 ./role-menu 或 ./auto-role;在
content/docs/commands/auto-role.zh-cn.mdx 第20-24行與
content/docs/commands/role-menu.zh-cn.mdx 第34-40行,改用 ../basics/#身份组的顺序很重要 與
./role-menu 或 ./auto-role。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/home/Hero.tsx`:
- Around line 76-90: 移除 Hero.tsx 76-90 中 docs 連結寫死的 `/zh-tw`
前綴,改用目前使用者語系動態產生路徑;同步更新 src/home/features/Dashboard.tsx 57-61 的 role-menu docs
連結。檢視 config.ts 11-19 的頁尾連結與 src/blog/layouts.tsx 98-104
的部落格連結,僅在對應頁面支援多語系時改為動態語系路徑,若目前僅有繁體中文版則保留現有前綴。

---

Nitpick comments:
In `@content/docs/commands/auto-role.mdx`:
- Around line 20-24: 統一四個文件中的內部連結為相對路徑:在 content/docs/commands/auto-role.mdx
第20-24行與 content/docs/commands/role-menu.mdx 第34-40行,移除 /docs 前綴並分別改用
../basics/#身分組的順序很重要 與同層的 ./role-menu 或 ./auto-role;在
content/docs/commands/auto-role.zh-cn.mdx 第20-24行與
content/docs/commands/role-menu.zh-cn.mdx 第34-40行,改用 ../basics/#身份组的顺序很重要 與
./role-menu 或 ./auto-role。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 695e9000-2213-427c-a2e4-f2d7fd9066be

📥 Commits

Reviewing files that changed from the base of the PR and between fe8e470 and d630af8.

⛔ Files ignored due to path filters (48)
  • bun.lock is excluded by !**/*.lock
  • public/docs/chat/chat-create.png is excluded by !**/*.png
  • public/docs/chat/chat-info.png is excluded by !**/*.png
  • public/docs/commands/example-help.png is excluded by !**/*.png
  • public/docs/commands/example-usage.png is excluded by !**/*.png
  • public/docs/commands/help.png is excluded by !**/*.png
  • public/docs/commands/ticket/category-create-channel.png is excluded by !**/*.png
  • public/docs/commands/ticket/create-category.png is excluded by !**/*.png
  • public/docs/commands/ticket/create-channel-modal.png is excluded by !**/*.png
  • public/docs/commands/ticket/send-message.png is excluded by !**/*.png
  • public/docs/commands/ticket/set-permissions.png is excluded by !**/*.png
  • public/docs/commands/ticket/settings.png is excluded by !**/*.png
  • public/docs/commands/ticket/ticket-message.png is excluded by !**/*.png
  • public/docs/dashboard/login.png is excluded by !**/*.png
  • public/docs/dashboard/select-server.png is excluded by !**/*.png
  • public/docs/dvc/dvc-command.png is excluded by !**/*.png
  • public/docs/dvc/dvc.png is excluded by !**/*.png
  • public/docs/dvc/voice-channel.png is excluded by !**/*.png
  • public/docs/join-message/advanced-settings.png is excluded by !**/*.png
  • public/docs/join-message/copy-channel-id.png is excluded by !**/*.png
  • public/docs/join-message/copy-image-url.png is excluded by !**/*.png
  • public/docs/join-message/enable-developer-mode.png is excluded by !**/*.png
  • public/docs/join-message/join-message-form.png is excluded by !**/*.png
  • public/docs/join-message/join-message-index.jpg is excluded by !**/*.jpg
  • public/docs/join-message/join-message-panel.png is excluded by !**/*.png
  • public/docs/join-message/select-role.png is excluded by !**/*.png
  • public/docs/join-message/user-settings.png is excluded by !**/*.png
  • public/docs/poll/poll-choices.png is excluded by !**/*.png
  • public/docs/poll/poll-choices_show.png is excluded by !**/*.png
  • public/docs/poll/poll-command.png is excluded by !**/*.png
  • public/docs/poll/poll-csv_output.png is excluded by !**/*.png
  • public/docs/poll/poll-done.png is excluded by !**/*.png
  • public/docs/poll/poll-example.png is excluded by !**/*.png
  • public/docs/poll/poll-excel_output.png is excluded by !**/*.png
  • public/docs/poll/poll-operation.png is excluded by !**/*.png
  • public/docs/poll/poll-remove_user.png is excluded by !**/*.png
  • public/docs/poll/poll-result.png is excluded by !**/*.png
  • public/docs/poll/poll-settings.png is excluded by !**/*.png
  • public/docs/poll/poll-settings_input.png is excluded by !**/*.png
  • public/docs/role/create-channel-modal.png is excluded by !**/*.png
  • public/docs/role/create-channel.png is excluded by !**/*.png
  • public/docs/role/create-roles.png is excluded by !**/*.png
  • public/docs/role/emoji.png is excluded by !**/*.png
  • public/docs/role/role.png is excluded by !**/*.png
  • public/docs/role/set-permissions.png is excluded by !**/*.png
  • public/docs/role/settings.png is excluded by !**/*.png
  • public/docs/rpg/shop/shop-add.png is excluded by !**/*.png
  • public/docs/rpg/shop/shop.png is excluded by !**/*.png
📒 Files selected for processing (34)
  • components.json
  • config.ts
  • content/docs/commands/auto-role.mdx
  • content/docs/commands/auto-role.zh-cn.mdx
  • content/docs/commands/giveaway.mdx
  • content/docs/commands/giveaway.zh-cn.mdx
  • content/docs/commands/index.mdx
  • content/docs/commands/index.zh-cn.mdx
  • content/docs/commands/member-notification.mdx
  • content/docs/commands/member-notification.zh-cn.mdx
  • content/docs/commands/meta.json
  • content/docs/commands/meta.zh-cn.json
  • content/docs/commands/poll.mdx
  • content/docs/commands/poll.zh-cn.mdx
  • content/docs/commands/role-menu.mdx
  • content/docs/commands/role-menu.zh-cn.mdx
  • content/docs/commands/role.mdx
  • content/docs/find-food.mdx
  • content/docs/find-food.zh-cn.mdx
  • package.json
  • press.config.tsx
  • public/_redirects
  • src/app.css
  • src/blog/layouts.tsx
  • src/components/mdx/cmd.tsx
  • src/components/mdx/discord-demo.tsx
  • src/components/mdx/discord.tsx
  • src/components/ui/tooltip.tsx
  • src/home/Hero.tsx
  • src/home/features/Dashboard.tsx
  • src/home/features/Games.tsx
  • src/home/features/Music.tsx
  • src/layout-config.tsx
  • src/root-layout.tsx
💤 Files with no reviewable changes (1)
  • content/docs/commands/role.mdx
🚧 Files skipped from review as they are similar to previous changes (11)
  • content/docs/commands/meta.zh-cn.json
  • content/docs/commands/index.zh-cn.mdx
  • content/docs/commands/meta.json
  • content/docs/find-food.zh-cn.mdx
  • content/docs/commands/poll.zh-cn.mdx
  • content/docs/find-food.mdx
  • content/docs/commands/giveaway.zh-cn.mdx
  • src/components/mdx/discord.tsx
  • content/docs/commands/poll.mdx
  • content/docs/commands/index.mdx
  • src/components/mdx/discord-demo.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/components/mdx/command-header.tsx (1)

83-85: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

建議使用 next/link 來處理內部導覽。

使用原生的 <a> 標籤進行內部路由跳轉會觸發整個頁面的重新載入 (full page reload)。在 Next.js 環境中,建議使用 next/link 來保持 SPA 的流暢體驗。

♻️ 建議的修改

首先在檔案頂部引入 Link

import Link from "next/link";

然後將 <a> 替換為 <Link>

-        <p className="px-4 py-2 text-xs text-fd-muted-foreground">
-          {t.hint} <a href={t.basicsUrl}>{t.hintLink}</a>
-        </p>
+        <p className="px-4 py-2 text-xs text-fd-muted-foreground">
+          {t.hint} <Link href={t.basicsUrl}>{t.hintLink}</Link>
+        </p>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/mdx/command-header.tsx` around lines 83 - 85, Replace the
internal navigation anchor in the command header JSX with Next.js’s `Link`
component, importing it from `next/link`, while preserving the existing
`t.basicsUrl` destination and `t.hintLink` content.
src/components/mdx/discord-demo.tsx (1)

91-109: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

移除無作用的 <AnimatePresence>

<AnimatePresence> 只有在內部元件發生掛載或卸載 (mount/unmount) 時才會發揮作用。由於此處的 <Cell> 元件是永久渲染的,僅透過 active 屬性來改變透明度,因此 <AnimatePresence> 實際上並無作用。建議將其移除以簡化程式碼結構。

♻️ 建議的修改
-              <div className="flex overflow-hidden rounded-md border border-discord-secondary">
-                <AnimatePresence initial={false}>
-                  <Cell
-                    active={done && !permission.enabled}
-                    className="bg-discord-danger"
-                  >
-                    <X className="size-4" />
-                  </Cell>
-                  <Cell active={!done} className="bg-discord-secondary">
-                    <span className="px-1 text-xs">/</span>
-                  </Cell>
-                  <Cell
-                    active={done && permission.enabled}
-                    className="bg-discord-success"
-                  >
-                    <Check className="size-4" />
-                  </Cell>
-                </AnimatePresence>
-              </div>
+              <div className="flex overflow-hidden rounded-md border border-discord-secondary">
+                <Cell
+                  active={done && !permission.enabled}
+                  className="bg-discord-danger"
+                >
+                  <X className="size-4" />
+                </Cell>
+                <Cell active={!done} className="bg-discord-secondary">
+                  <span className="px-1 text-xs">/</span>
+                </Cell>
+                <Cell
+                  active={done && permission.enabled}
+                  className="bg-discord-success"
+                >
+                  <Check className="size-4" />
+                </Cell>
+              </div>

若進行了上述修改,檔案頂部的引入也請同步更新(移除 AnimatePresence):

import { motion } from "framer-motion";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/mdx/discord-demo.tsx` around lines 91 - 109, Remove the
ineffective AnimatePresence wrapper around the three Cell components in the
Discord demo, leaving the Cells rendered directly with their existing active and
className props. Also remove AnimatePresence from the framer-motion import while
preserving any remaining motion import.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@public/_redirects`:
- Around line 18-39: 在 public/_redirects 的舊 docs 指定轉址區塊中新增 /docs/music 與
/docs/commands/music 的 301 規則,將兩者導向有效的移除功能替代頁面(至少 /zh-tw/docs),並確保規則位於 blanket
/docs/* 規則之前。

In `@src/og-image.tsx`:
- Around line 1-6: Update the Logo component to stop importing logo.svg with the
?raw suffix; use the publicly served /img/logo.svg URL or an equivalent data URI
as the <img src> value, while preserving the existing size dimensions.

---

Nitpick comments:
In `@src/components/mdx/command-header.tsx`:
- Around line 83-85: Replace the internal navigation anchor in the command
header JSX with Next.js’s `Link` component, importing it from `next/link`, while
preserving the existing `t.basicsUrl` destination and `t.hintLink` content.

In `@src/components/mdx/discord-demo.tsx`:
- Around line 91-109: Remove the ineffective AnimatePresence wrapper around the
three Cell components in the Discord demo, leaving the Cells rendered directly
with their existing active and className props. Also remove AnimatePresence from
the framer-motion import while preserving any remaining motion import.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 05add499-fc99-4f23-97b3-6d6185989176

📥 Commits

Reviewing files that changed from the base of the PR and between 1eed25a and dbaee53.

⛔ Files ignored due to path filters (54)
  • bun.lock is excluded by !**/*.lock
  • public/docs/chat/chat-create.png is excluded by !**/*.png
  • public/docs/chat/chat-info.png is excluded by !**/*.png
  • public/docs/commands/example-help.png is excluded by !**/*.png
  • public/docs/commands/example-usage.png is excluded by !**/*.png
  • public/docs/commands/help.png is excluded by !**/*.png
  • public/docs/commands/ticket/category-create-channel.png is excluded by !**/*.png
  • public/docs/commands/ticket/create-category.png is excluded by !**/*.png
  • public/docs/commands/ticket/create-channel-modal.png is excluded by !**/*.png
  • public/docs/commands/ticket/send-message.png is excluded by !**/*.png
  • public/docs/commands/ticket/set-permissions.png is excluded by !**/*.png
  • public/docs/commands/ticket/settings.png is excluded by !**/*.png
  • public/docs/commands/ticket/ticket-message.png is excluded by !**/*.png
  • public/docs/dashboard/login.png is excluded by !**/*.png
  • public/docs/dashboard/select-server.png is excluded by !**/*.png
  • public/docs/dvc/dvc-command.png is excluded by !**/*.png
  • public/docs/dvc/dvc.png is excluded by !**/*.png
  • public/docs/dvc/voice-channel.png is excluded by !**/*.png
  • public/docs/join-message/advanced-settings.png is excluded by !**/*.png
  • public/docs/join-message/copy-channel-id.png is excluded by !**/*.png
  • public/docs/join-message/copy-image-url.png is excluded by !**/*.png
  • public/docs/join-message/enable-developer-mode.png is excluded by !**/*.png
  • public/docs/join-message/join-message-form.png is excluded by !**/*.png
  • public/docs/join-message/join-message-index.jpg is excluded by !**/*.jpg
  • public/docs/join-message/join-message-panel.png is excluded by !**/*.png
  • public/docs/join-message/select-role.png is excluded by !**/*.png
  • public/docs/join-message/user-settings.png is excluded by !**/*.png
  • public/docs/poll/poll-choices.png is excluded by !**/*.png
  • public/docs/poll/poll-choices_show.png is excluded by !**/*.png
  • public/docs/poll/poll-command.png is excluded by !**/*.png
  • public/docs/poll/poll-csv_output.png is excluded by !**/*.png
  • public/docs/poll/poll-done.png is excluded by !**/*.png
  • public/docs/poll/poll-example.png is excluded by !**/*.png
  • public/docs/poll/poll-excel_output.png is excluded by !**/*.png
  • public/docs/poll/poll-operation.png is excluded by !**/*.png
  • public/docs/poll/poll-remove_user.png is excluded by !**/*.png
  • public/docs/poll/poll-result.png is excluded by !**/*.png
  • public/docs/poll/poll-settings.png is excluded by !**/*.png
  • public/docs/poll/poll-settings_input.png is excluded by !**/*.png
  • public/docs/role/create-channel-modal.png is excluded by !**/*.png
  • public/docs/role/create-channel.png is excluded by !**/*.png
  • public/docs/role/create-roles.png is excluded by !**/*.png
  • public/docs/role/emoji.png is excluded by !**/*.png
  • public/docs/role/role.png is excluded by !**/*.png
  • public/docs/role/set-permissions.png is excluded by !**/*.png
  • public/docs/role/settings.png is excluded by !**/*.png
  • public/docs/rpg/shop/shop-add.png is excluded by !**/*.png
  • public/docs/rpg/shop/shop.png is excluded by !**/*.png
  • public/img/logo-transparent.png is excluded by !**/*.png
  • public/img/logo.png is excluded by !**/*.png
  • public/img/logo.svg is excluded by !**/*.svg
  • public/img/logo_1024x1024.png is excluded by !**/*.png
  • public/img/logo_128x128.png is excluded by !**/*.png
  • public/img/logo_512x512.png is excluded by !**/*.png
📒 Files selected for processing (80)
  • _redirects
  • components.json
  • config.ts
  • content/docs/basics.mdx
  • content/docs/basics.zh-cn.mdx
  • content/docs/commands/auto-channels.mdx
  • content/docs/commands/auto-channels.zh-cn.mdx
  • content/docs/commands/auto-role.mdx
  • content/docs/commands/auto-role.zh-cn.mdx
  • content/docs/commands/bot-fight.mdx
  • content/docs/commands/bot-fight.zh-cn.mdx
  • content/docs/commands/chat.mdx
  • content/docs/commands/clear.mdx
  • content/docs/commands/clear.zh-cn.mdx
  • content/docs/commands/dvc.mdx
  • content/docs/commands/giveaway.mdx
  • content/docs/commands/giveaway.zh-cn.mdx
  • content/docs/commands/index.mdx
  • content/docs/commands/index.zh-cn.mdx
  • content/docs/commands/join-message.mdx
  • content/docs/commands/list.mdx
  • content/docs/commands/lock-channel.mdx
  • content/docs/commands/lock-channel.zh-cn.mdx
  • content/docs/commands/lol.mdx
  • content/docs/commands/lol.zh-cn.mdx
  • content/docs/commands/member-notification.mdx
  • content/docs/commands/member-notification.zh-cn.mdx
  • content/docs/commands/meta.json
  • content/docs/commands/meta.zh-cn.json
  • content/docs/commands/poll.mdx
  • content/docs/commands/poll.zh-cn.mdx
  • content/docs/commands/reference/general.mdx
  • content/docs/commands/reference/index.mdx
  • content/docs/commands/reference/meta.json
  • content/docs/commands/role-menu.mdx
  • content/docs/commands/role-menu.zh-cn.mdx
  • content/docs/commands/role.mdx
  • content/docs/commands/ticket.mdx
  • content/docs/commands/utility.mdx
  • content/docs/commands/utility.zh-cn.mdx
  • content/docs/contribute/guide.mdx
  • content/docs/contribute/run-project.mdx
  • content/docs/faq.mdx
  • content/docs/faq.zh-cn.mdx
  • content/docs/find-food.mdx
  • content/docs/find-food.zh-cn.mdx
  • content/docs/index.mdx
  • content/docs/index.zh-cn.mdx
  • content/docs/meta.json
  • content/docs/meta.zh-cn.json
  • content/docs/rpg/index.mdx
  • content/docs/rpg/introduction.mdx
  • content/docs/rpg/jobs.mdx
  • content/docs/rpg/make.mdx
  • content/docs/rpg/meta.json
  • content/docs/rpg/shop.mdx
  • package.json
  • press.config.tsx
  • public/_redirects
  • src/app.css
  • src/blog/layouts.tsx
  • src/components/Footer.tsx
  • src/components/blog/BlogItem.tsx
  • src/components/mdx/cmd.tsx
  • src/components/mdx/command-header.tsx
  • src/components/mdx/discord-demo.tsx
  • src/components/mdx/discord.tsx
  • src/components/mdx/index.tsx
  • src/components/ui/tooltip.tsx
  • src/home/Hero.tsx
  • src/home/features/Dashboard.tsx
  • src/home/features/Games.tsx
  • src/home/features/Music.tsx
  • src/layout-config.tsx
  • src/og-image.tsx
  • src/pages/404.tsx
  • src/pages/_layout.tsx
  • src/pages/index.tsx
  • src/root-layout.tsx
  • src/search-plugin.ts
💤 Files with no reviewable changes (16)
  • content/docs/rpg/meta.json
  • content/docs/commands/chat.mdx
  • content/docs/commands/reference/meta.json
  • content/docs/rpg/make.mdx
  • content/docs/rpg/shop.mdx
  • content/docs/rpg/index.mdx
  • content/docs/rpg/introduction.mdx
  • content/docs/commands/reference/general.mdx
  • content/docs/commands/dvc.mdx
  • content/docs/rpg/jobs.mdx
  • content/docs/commands/join-message.mdx
  • content/docs/commands/list.mdx
  • _redirects
  • content/docs/commands/ticket.mdx
  • content/docs/commands/reference/index.mdx
  • content/docs/commands/role.mdx
🚧 Files skipped from review as they are similar to previous changes (48)
  • content/docs/commands/meta.zh-cn.json
  • components.json
  • src/pages/_layout.tsx
  • content/docs/commands/auto-role.mdx
  • content/docs/commands/auto-role.zh-cn.mdx
  • src/pages/404.tsx
  • content/docs/basics.zh-cn.mdx
  • content/docs/meta.zh-cn.json
  • content/docs/commands/bot-fight.mdx
  • content/docs/commands/lol.mdx
  • src/blog/layouts.tsx
  • content/docs/commands/clear.zh-cn.mdx
  • src/root-layout.tsx
  • content/docs/commands/clear.mdx
  • content/docs/commands/member-notification.zh-cn.mdx
  • content/docs/commands/role-menu.mdx
  • content/docs/commands/lol.zh-cn.mdx
  • src/home/Hero.tsx
  • content/docs/find-food.mdx
  • content/docs/commands/giveaway.zh-cn.mdx
  • src/home/features/Dashboard.tsx
  • content/docs/find-food.zh-cn.mdx
  • content/docs/commands/role-menu.zh-cn.mdx
  • src/layout-config.tsx
  • src/home/features/Games.tsx
  • config.ts
  • content/docs/meta.json
  • src/home/features/Music.tsx
  • content/docs/commands/utility.mdx
  • content/docs/index.mdx
  • content/docs/index.zh-cn.mdx
  • package.json
  • content/docs/commands/lock-channel.zh-cn.mdx
  • content/docs/commands/poll.mdx
  • content/docs/commands/auto-channels.mdx
  • content/docs/commands/member-notification.mdx
  • src/search-plugin.ts
  • content/docs/commands/giveaway.mdx
  • content/docs/faq.zh-cn.mdx
  • src/components/mdx/discord.tsx
  • src/components/mdx/index.tsx
  • src/components/ui/tooltip.tsx
  • src/components/mdx/cmd.tsx
  • content/docs/commands/index.mdx
  • content/docs/commands/poll.zh-cn.mdx
  • content/docs/commands/utility.zh-cn.mdx
  • content/docs/commands/lock-channel.mdx
  • press.config.tsx

Comment thread public/_redirects Outdated
Comment thread src/og-image.tsx
Comment on lines +1 to +6
import logoSvg from "../public/img/logo.svg?raw";

const GREEN = "#6bb369";

function Logo({ size }: { size: number }) {
return (
<svg width={size} height={size} viewBox="0 0 128 128">
<path
d="M43.3522 25.2578C52.946 9.29013 72.5335 4.51549 81.128 4.12413C85.15 3.46785 94.7859 5.5398 99 7.38145C103.214 9.22311 107.699 10.3815 114.5 18.8815C121.301 27.3815 123 41.8815 123 51.8815C123 61.8815 118.222 77.4108 109.31 84.5494C107.413 86.0689 103.482 87.3457 98.5168 88.4495V115.881C98.5168 120.3 94.9351 123.881 90.5168 123.881H57.3483C52.9301 123.881 49.3483 120.3 49.3483 115.881V94.9799C35.5571 94.9799 23.5649 92.768 17.5687 89.8328C11.5725 86.8976 1.97863 78.6789 4.37712 65.1769C6.85518 51.2269 23.5648 46.9785 33.1587 48.7396C33.7583 46.3914 33.7583 41.2254 43.3522 25.2578Z"
fill="#4ade80"
/>
</svg>
);
return <img src={logoSvg} width={size * (1580 / 2083)} height={size} />;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 尋找專案中其他引入 svg 的方式,確認是否應移除 ?raw 或是將字串轉為 data URI。
rg "import .* from .*svg" src/

Repository: yeecord/website

Length of output: 220


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## src/og-image.tsx\n'
cat -n src/og-image.tsx

printf '\n## related SVG imports\n'
rg -n "logoSvg|\\?raw|svg" src public vite.config.* astro.config.* package.json

Repository: yeecord/website

Length of output: 24432


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## Vite / build config files\n'
git ls-files | rg '^(vite\.config\.[jt]s|astro\.config\.[jt]s|package\.json|src/.*|public/.*)$'

Repository: yeecord/website

Length of output: 11588


🌐 Web query:

Vite ?raw import public directory image src import raw svg data URI publicDir

💡 Result:

In Vite, importing assets and accessing the public directory involve different mechanisms. The?raw suffix is used to import an asset as a plain string, containing the file's contents [1][2]. This is useful for importing things like GLSL shaders or other text-based files [1]. Regarding the public directory: - Assets placed in the public directory (default /public) are served at the root path during development and copied to the root of the dist directory as-is during the build [3][4]. - Crucially, assets in the public directory cannot be imported directly from JavaScript using import statements [4]. You should always reference them using root-absolute paths (e.g., /image.png) [4]. For SVG and image handling: - Importing an SVG or image file (without a query) typically returns its URL [1][5]. - However, Vite automatically inlines small assets as data URIs during the build process [5]. You can control this behavior or disable it globally using the build.assetsInlineLimit configuration option [5][6]. - If you specifically need the URL for an asset that is otherwise being inlined, you can use the?url suffix to force Vite to treat the import as a URL to the static asset instead of the file content [5][6]. - If you need to manipulate or get raw SVG data specifically, standard Vite does not provide built-in advanced SVG handling (like SVGR or automatic data URI conversion); for such features, community plugins are often used [7][8].

Citations:


改用 /img/logo.svg 或 data URI。 ?raw 會把 SVG 變成原始字串,<img src> 需要的是可載入的網址,這裡會讓 OG 圖片無法正常顯示。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/og-image.tsx` around lines 1 - 6, Update the Logo component to stop
importing logo.svg with the ?raw suffix; use the publicly served /img/logo.svg
URL or an equivalent data URI as the <img src> value, while preserving the
existing size dimensions.

@kane50613 kane50613 changed the title rewrite docs for slash commands with i18n and command visuals [next] rewrite docs for slash commands with i18n and command visuals Jul 21, 2026
@kane50613
kane50613 force-pushed the next branch 2 times, most recently from a75d685 to b55b8d3 Compare July 29, 2026 06:00
kane50613 added 19 commits July 30, 2026 15:51
- switch to default locale now drops the /zh-tw prefix instead of stacking
- switching does a full navigation to the correct static route
- canonical points every default-locale page at its unprefixed url
- /zh-tw redirects to root
- all locales now live under /zh-tw and /zh-cn like upstream expects
- remove defaultLocalePlugin, localeSwitchPlugin and locale-switch client hack
- old unprefixed urls 301 to /zh-tw via _redirects (blog listed per-slug,
  avatars still live under /blog/)
- add canonical + hreflang zh-Hant/zh-Hans/x-default on every page
- delete orphaned public/docs screenshots so /docs/* can blanket-redirect
kane50613 added 17 commits July 30, 2026 15:51
* explain what changed in the rewrite

* explain per-command permissions and tighten the page

* open a modal from the poll command and list every removed feature

* drop the list of minor removals

* give the home page room to breathe on a phone
Both pages now read their strings from a per-locale copy dictionary, and the
zh-cn versions are registered outside src/pages so they get their own root
layout and a correct html lang. The demo components used in the docs take a
locale prop, bound to the page locale in press.config.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
The contribute section, copyright, credit, privacy and terms had no zh-cn
version and fell back to traditional chinese. Also points the zh-cn install
links at /zh-cn/install/ and fixes the privacy link in the terms page.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
Reactions and embeds are gone since the rewrite, so the required set drops
ADD_REACTIONS and EMBED_LINKS. The defense card now carries MANAGE_MESSAGES
because bot-fight clears the spammer's messages, and a card for MENTION_EVERYONE
covers the giveaway and poll pings.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
src/i18n.ts now holds every language the site ships, with its label, hreflang,
UI preset and whether search needs the mandarin tokenizer. The nav, footer,
hreflang set, search index and the static routes for the non-default languages
all read from it, so adding a language is one entry plus a copy dictionary
rather than edits in seven places.

The mdx demo components drop their own "tw" | "cn" codes for the shared Locale
union, and the import alias moves from @/ to ~/.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
Components now call t("一隻恐龍") with the zh-tw text as the key, so they read as
written and a language is one file under src/i18n/translations. fuma-translate
was the plan, but its runtime is "use client" only and the marketing pages, the
nav, the footer and the page metadata are all server components, so this is the
same model in about thirty lines with no build step.

English joins as the third language: the static pages are translated, while the
docs, blog and legal pages fall back to chinese and carry noindex until someone
translates them. The docs demo components keep their own tables and fall back to
zh-tw for the same reason.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
In dark mode fd-secondary sits almost on top of the page background, so the
button read as a flat slab and its chunky ledge disappeared into it. It now uses
the card surface with a border, leaving the filled green as the only primary.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
googleFonts() sat inside the per-page generate(), so every og image
re-downloaded all three families, each attempt giving up after the helper's 5s
default. That is 135 image renders now that english is in, which is what keeps
timing out on Cloudflare. Hoisting it shares one promise across the build and
the timeout goes to 30s for the one request that remains.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
Outlining it broke the toy look the chunky buttons are going for. The problem
was only that fd-secondary sits within a hair of the page background in dark
mode, so the fill and its ledge are now mixed from the foreground colour, which
keeps a visible step in both themes.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
The nav listed every other language as its own link, which is noise once there
are three of them. fumadocs' switch only swaps the first path segment, so the
default language now also ships under its prefix for the switch to land on,
canonical pointing back at the bare path and _redirects sending hard requests
there too.

Everything was also set in Noto Sans TC, so english ran on its latin glyphs,
which are an afterthought in a CJK family. Manrope leads the stack now and CJK
falls through to Noto Sans TC, matching what the og images already render with.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
gg sans and Whitney before it are licensed to Discord and cannot be served, but
the stack the web client falls back to can. Anyone with the desktop app installed
gets gg sans, everyone else sees what a Discord user without it sees, and the
rest of the site keeps Manrope.

Claude-Session: https://claude.ai/code/session_01UUcpnAXNzsYjXdNikb7AU7
gg sans is discord's own font, so the site runs the face discord itself
falls back to instead. logo text drops to 600 to sit at discord's heading
weight, and the standalone slash command mock joins the other mocks in the
discord stack.

the install picker's feature cards now stack from the top: a button centres
its content vertically, so a card stretched by a taller neighbour in the
same row sat lower than it.

Claude-Session: https://claude.ai/code/session_01KknFS5B4aZDpQuMPmdg4y3
noto sans sat right on top of noto sans tc's own latin, so the extra family
bought nothing. geist keeps the neutral grotesque look and is ofl too.

Claude-Session: https://claude.ai/code/session_01KknFS5B4aZDpQuMPmdg4y3
The renovate swap replaced the package but left every import
on the old framer-motion name, which only resolved through the
transitive dep.

Claude-Session: https://claude.ai/code/session_013tfN2NCJ4ai7221uMTqT1j
kane50613 added 12 commits July 30, 2026 16:14
The old static opengraph-image.png and branding.png carried the
previous logo. A build-time route now renders the hero night
scene at the same path, so every existing reference keeps
working.

Claude-Session: https://claude.ai/code/session_013tfN2NCJ4ai7221uMTqT1j
* align bot docs and homepage copy

* drop Chinese copy punctuation

* fix docs links and form commands
# Conflicts:
#	public/_headers
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.

1 participant