Skip to content

feat(components): 元件下載區改為與原始碼自動同步#75

Open
tony140407 wants to merge 2 commits into
mainfrom
feat/components-downloads-sync
Open

feat(components): 元件下載區改為與原始碼自動同步#75
tony140407 wants to merge 2 commits into
mainfrom
feat/components-downloads-sync

Conversation

@tony140407

Copy link
Copy Markdown
Contributor

背景與動機

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 — 兩種使用情境

  • 一般使用(無 build pipeline):以 <link> 引用或下載 main.css(Hugo build 本來就會產出 /main.css,零額外成本)。
  • 進階使用(SCSS pipeline):下載 scss-source.zip,內含 css/(元件 SCSS 原始碼)與 svgs/(元件樣式引用的圖示),解壓後自選元件 import。

JS — 兩種取得方式

  • 個別下載:於各元件頁面取得對應 JS 檔。
  • 一次取全部:下載 js-components.zip,統一以 type="module" 載入。

頁面結構

  • _index.md 不再逐一列舉 JS 元件,改以「pattern + 2 個範例」呈現引用方式,細節導引至各元件頁面。

變更內容

  • content/components/_index.mdreadme.md:重寫 CSS / JS 兩段使用說明。
  • .github/workflows/build.ymldeploy-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。

@gemini-code-assist gemini-code-assist 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.

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.

Comment thread readme.md
Comment thread readme.md
- 一般使用:以 `<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 元件詳細用法位置,避免依賴版面位置描述
@tony140407 tony140407 force-pushed the feat/components-downloads-sync branch from 3da3f9c to 25f12ed Compare June 9, 2026 07:18
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

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