建立github pages 教學

 

github pages有分兩種,

  • user&organization pages與project pages

user&organization pages一個github帳號中只能有一個,

而project pages則可以多個。

  • user&organization  pages比較像是個人的potal,

project pages則為各個project的首頁。

 

以我的github帳號brooke01為例:

我的user&organization pages網址為http://brooke01.github.io

則要在github裡開一個brooke01.github.io專案

 

我的project pages網址為http://brooke01.github.io/LearningAccount

則要在github裡開一個LearningAccount專案

 

我的建立經驗:

  • user&organization :

如果都開完專案設定好了還是404畫面的話,則嘗試另開一個叫做gh-pages的branch即可

  • project pages(使用Jekyll):

開完LearningAccount專案後,於該專案右邊畫面按下Settings按鈕

Alternate Text

接著於Setting頁面尋找GitHub Pages區塊,按下Automatic page generator按鈕

Alternate Text

接著你會看到可以編輯html的編輯器,編輯好按下continue to layouts再按下publish page按鈕

Alternate Text

 

  • project pages(使用Html):

如果不想用github所提供的theme的話,那只要於project另開gh-pages branch,

使用其所提供的預設路徑就可以了。

之後如果遇到專案設定好了還是404畫面時,嘗試對index.html做變動,馬上就連的到了。

Alternate Text

 

 

参考資料:

在github建立靜態網站

建立github.io專頁

如何在 GitHub 建立个人主页和项目演示页面

为多个github项目生成Github Pages并指定域名

GitHub Pages Basics

Creating Pages with the automatic generator