一頁式旅遊商品導購網站,以每月優惠快報形式展示商品與延伸文章。網站使用 Jekyll,可部署到 GitHub Pages。
bin/setup
bin/dev開啟 http://127.0.0.1:4000。bin/dev 會啟動 Jekyll live reload,修改 markdown、layout、CSS 或 JS 後會自動重新產生。
可用環境變數調整 host 與 port:
PORT=4100 bin/dev
HOST=0.0.0.0 PORT=4100 bin/dev
LIVERELOAD_PORT=35731 bin/devbin/doctor
bin/testbin/doctor:確認 Ruby、Bundler、gems 與範例快報狀態。bin/test:用 production 環境執行jekyll build --strict_front_matter --trace,再檢查首頁、月報頁、商品 CTA、倒數 ISO 時間與文章欄目。make dev、make test、make build也可以使用。
清除 Jekyll 輸出:
make clean此專案已包含 GitHub Actions workflow:.github/workflows/pages.yml。
- 到 GitHub repo 的
Settings→Pages。 Build and deployment的Source選GitHub Actions。- 確認 default branch 是
main。 - Push 到
main後,GitHub Actions 會執行bin/test,成功後部署_site到 GitHub Pages。
自訂網域使用根目錄 CNAME:
tripezgo.comDNS 需要指到 GitHub Pages。若使用 apex domain tripezgo.com,在 DNS 設定 A records 到 GitHub Pages IP;若使用 www.tripezgo.com,用 CNAME 指到 ZhgChgLi.github.io。
在 _reports 新增 YYYY-MM.md,並用 YAML front matter 維護商品與文章資料。首頁會自動依 month 取最新月份。
商品欄位:
nameimagedescriptiontagspricesale_priceurloffer_ends_at,選填,ISO 時間字串category,選填,用來分組顯示商品category_en,選填,分類英文短標category_hint,選填,分類說明文字
文章欄位:
titleimageurlsource,選填