Conversation
Ported from tmp/0726 f3f587e
…ar after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.
Ported from tmp/0726 cbb8f77
Ported from tmp/0726 91d6761
… with given exectly one selector Ported from tmp/0726 1867956 (main.js and form-elements.html already reflected in Hugo main)
live-example.html was not forwarding i18n and i18n_selector to the example.html partial, so the language selector never rendered. Also fix $.i18n_selector reference inside with .i18n block where the dot context changes to the i18n string.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此 PR 旨在將 Jekyll 版本的修正遷移至 Hugo 環境,主要處理了 SCSS 樣式表的相容性問題、國際化 (i18n) 文字內容的擴充與修正,以及修復了 Live Example 語言切換功能中的 Hugo 端錯誤,確保網站功能和顯示的正確性。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
您好,感謝您對 SCSS、i18n 文字以及語言切換功能的修正。
這次的 Pull Request 包含多項重要的遷移與修正:
- SCSS 相容性:透過調整
rgb()語法及樣式規則順序,解決了 Sass 的棄用警告,提升了程式碼的相容性。 - i18n 內容擴充:更新了按鈕和表單的英文翻譯,使多語系支援更完整。
- Hugo 模板修正:修復了
live-exampleshortcode 中 i18n 參數傳遞的 bug,讓語言切換功能恢復正常。
整體而言,這些都是很棒的改進。我只在 content/components/form/_index.md 中發現一個與無效 HTML 相關的小問題,並提供了一則評論建議。請再確認一下。謝謝!
content/components/form/_index.md
Outdated
| ### 簡易欄位 | ||
|
|
||
| {{< live-example partial="form/form-elements.html" i18n_selector="[for=name],[for=city],[for=desc]" i18n="en-US:Full name,City of residence,Description" >}} | ||
| {{< live-example partial="form/form-elements.html" i18n_selector="[for=name],[for=city],[for=desc],[for=select],[for=taipei],[for=newtaipei],[for=keelung]" i18n="en-US:Full name,City of residence,Description,Select,Taipei,New Taipei,Keelung" >}} |
There was a problem hiding this comment.
您好,您在 i18n_selector 中加入的 [for=select], [for=taipei], [for=newtaipei], [for=keelung] 選擇器,目標是 layouts/_partials/form/form-elements.html 裡的 <option> 元素。
然而,HTML 標準中 <option> 標籤並不支援 for 屬性,這屬於無效的 HTML。這可能會導致 i18n 功能不如預期,或在未來無法正常運作。
一個更穩健的做法是修改 layouts/_partials/form/form-elements.html,將 <option> 上的 for 屬性換成有效的屬性(例如 id),然後在這裡更新 i18n_selector。
例如,若 form-elements.html 改為:
<option id="taipei">台北市</option>此處的選擇器就應對應更新為 #taipei。
由於 form-elements.html 不在此次 PR 的範圍內,建議可以開立新的 issue 或 PR 來追蹤並修正這個底層的 HTML 問題,以確保元件的正確性與長期維護性。
- 移除 i18n 值末尾多餘的分號,避免程式解析錯誤。 - 修正 i18n_selector 從 [for=] 改為 [value=] 以正確對應 <option> 元素
d265277 to
eeeaeaf
Compare
變更內容
本 PR 包含三類修正,均從 Jekyll 版本遷移至 Hugo:
1. SCSS 相容性修正
carousel.scss:將rgb(0 0 0 / %)現代語法改為rgba()相容語法reset.scss:將margin: 0移至 nested rule 之前,修正 Sass Deprecation Warningtypography.scss:將&:lang()區塊移至:root結尾處,同上2. i18n 文字內容修正
button-and-link:英文版第三顆按鈕文字Cancel→Nextcheckable:英文版新增 Authentication method、TW FidO authentication 等翻譯;Health card ID更正為NHI Cardform:選項欄位與簡易欄位的英文 i18n 選擇器與翻譯擴充(NHI Card、Taipei、New Taipei、Keelung 等)3. Live Example 語言切換功能修正(Hugo 端 bug)
live-example.htmlshortcode 未將i18n、i18n_selector傳入example.html,導致語言選擇器完全不顯示example.html在with .i18n區塊內取不到 Site 參數,導致語言選項名稱空白