原本打算買域名,買空間,用wordpress寫博客的。後來問了一個師兄,他說他是用github的空間,用Jekyll寫博客,說不少人都這麼作。因而我就研究了一下。html
比較有價值的文章有這麼幾篇:git
http://kyle.xlau.org/posts/blogging-like-a-hacker.html :這個是Jekyll原做者的文章的譯文,必讀github
http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html 這個就是標題中提到的文章,清晰易懂,能夠循序漸進地跟着作。不過這篇文章有些注意點沒提到,由於做者可能用的是Mac(我用的是win7)web
我在把該文的小例子成功完成以後,在原文下寫了一個評論,抄過來:ruby
感謝博主的文章,清晰易懂:)不過,建議博主把回覆裏的注意點添加到博客正文中,省得被讀者忽略。好比yaml的代碼要頂頭寫,字符編碼要用UTF8無BOM(我是在win7中文版下,默認的編碼是ANSI,用notepad++轉換編碼後才成功)還有就是,在github上新建一個repo後再執行git remote add origin https://github.com/USERNAME/jekyll_demo.git會報錯:「fatal: remote origin already exists.」,網上有說能夠先執行git remote rm origin,可是我試了,也不行(報錯:error: Could not remove config section 'remote.origin'),不過git remote set-url origin git@github.com:USERNAME/jekyll_demo.git是可行的。因此建議博主用「git remote set-url origin git@github.com:USERNAME/jekyll_demo.git」代替「git remote add origin https://github.com/USERNAME/jekyll_demo.git」(我對git不熟,都是網上看來的,若有錯誤,還請指出)我是收到了5封page build failure才搞定,花了好長時間,但願後來人能夠少走點彎路吧最後,放上連接供有須要的同志們參考:https://github.com/ttang235/jekyll_demo