這是可以在專案進行的前提,討論在開始開發之前,先把前端初步的畫面先Demo的好方法,以下是建立github io 的完整工作流程。
-
創建 GitHub 帳號(如果還沒有)
- 前往 https://github.com 註冊
-
創建新的 Repository
- 登入後點右上角
+→New repository - Repository name:
? - 選擇 Public
- 點擊
Create repository
- 登入後點右上角
-
上傳文件
- 在 repository 頁面點
uploading an existing file - 將
index.html和 6 張圖片全部拖進去上傳 - 點
Commit changes
- 在 repository 頁面點
-
啟用 GitHub Pages
- 點
Settings→ 左側選單找Pages - Source 選擇
mainbranch - 點
Save
- 點
Step2 啟用 GitHub Pages
1. 進入 Settings
在您的 repository 頁面點上方的 Settings
2. 點擊 Pages
左側選單找到 Pages(在 Code and automation 下)
3. 設定部署來源
-
Source: 選
Deploy from a branch -
Branch: 選
main -
Folder: 選
/ (root) - 點 Save
4. 等待部署
- 等 1-2 分鐘
- 重新整理頁面,會看到綠色提示框顯示網址
5. 完成!
打開 https://您的github帳號.github.io/您的專案名稱/
Step3 更新
# 1. 編輯 index.html(用任何編輯器打開,修改聯絡資訊)
# 2. 提交變更
git add index.html git commit -m "更新聯絡電話和地址"
# 3. 推送
git push
# 4. 等待 30 秒 - 1 分鐘,網站自動更新!