feat(components): 元件下載區改為與原始碼自動同步#75
Open
tony140407 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in content/components/_index.md and readme.md to clarify CSS usage by splitting it into general and advanced SCSS methods, and to standardize JavaScript component imports using ES modules. The feedback suggests adding html language tags to the code blocks in readme.md to ensure proper syntax highlighting.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- 一般使用:以 `<link>` 引用或下載 main.css 後置於專案 - 進階使用:下載 scss-source.zip,於 SCSS pipeline 中自選元件 import - JS 元件以 ES module 載入,下載連結於各元件頁面 - 部署流程於 hugo build 後將 assets/css 打包為 public/zip/scss-source.zip
- CI 部署時將 static/js/components/ 打包為 public/zip/js-components.zip - 文件以「個別元件頁面」陳述 JS 元件詳細用法位置,避免依賴版面位置描述
3da3f9c to
25f12ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景與動機
content/components/_index.md原本提供「下載 css.zip」,但該 zip 是 commit 進 git 的二進位檔,最後一次手動更新是2023-10-13。其後新增的 SCSS 元件(accordion / modal / toolbar / date-picker / search-feedback 等)都沒進 zip;JS 區塊也只列 4 個元件,但
static/js/components/目前實際有 13 個。整個下載區塊長期與原始碼脫節,且唯一更新方式是「有人想到 → 手動壓縮 → commit」。本 PR 重新設計分發機制,讓下載檔在每次部署時自動跟著原始碼產生,不再需要手動維護。
設計
CSS — 兩種使用情境
<link>引用或下載main.css(Hugo build 本來就會產出/main.css,零額外成本)。scss-source.zip,內含css/(元件 SCSS 原始碼)與svgs/(元件樣式引用的圖示),解壓後自選元件 import。JS — 兩種取得方式
js-components.zip,統一以type="module"載入。頁面結構
_index.md不再逐一列舉 JS 元件,改以「pattern + 2 個範例」呈現引用方式,細節導引至各元件頁面。變更內容
content/components/_index.md、readme.md:重寫 CSS / JS 兩段使用說明。.github/workflows/build.yml、deploy-to-gh-pages.yml:於hugo build後新增 Package step,產出public/zip/scss-source.zip與
public/zip/js-components.zip。static/zip/css.zip。/public/已在.gitignore,新 zip 不會進 git。