2014-01-22 65 views
0

我正在嘗試Github頁面的水域,並且(暫時被困在機器上)無法在本地安裝Jekyll。我從文檔中得到的印象是,我應該能夠將Jekyll模板命令寫入內容中,並且Github在提交進來時會知道該怎麼做。Github Pages - 處理Jekyll內容而不在本地運行Jekyll?

但是,似乎並不發生。

具體來說,我說:_includes/header.html

<ul> 
    <li id="home_page">Home</li> 
    <li id="other_page">Other Stuff</li> 
</ul> 

,然後在根index.html

<body> 
{% include header.html %} 
<p>helloworld</p> 
</body> 

,但是當我去那個頁面,它顯示的,而不是待處理頁包含語句。我正在gh-pages分支中工作(並將其設置爲默認值)。

我需要採取哪些其他步驟才能真正讓Github處理模板?

+0

你推到正確的分支? https://help.github.com/articles/setting-up-a-custom-domain-with-pages#setting-the-domain-in-your-repo –

+0

我只是試圖直接從用戶名服務。 github.io/project_name,沒什麼特別的。 – Carl

回答

0

通過詢問Github上支持發現:

文件的傑奇處理實際獨一無二的。 They need to have a YAML block at the beginning, even if that block is empty。所以,上面的代碼基本上需要

--- <-- these two lines of dashes are 
--- <-- important 
<!doctype html> 
<html> 
<head> 
    <script type="text/javascript" src="site.js"></script> 
</head> 
<body> 
{% include header.html %} 
<p>some edit? helloworld</p> 
</body> 
</html> 
0

你需要開始,你想通過傑基爾處理文檔之前,包括破折號---的這兩行。如果您不這樣做,Jekyll只會簡單地複製您的文件,而不會運行這些命令。

可以將這些破折號之間指定不同的參數,如標題,描述,日期,標籤,類別等等等等