http://www.docin.com/p-888648541.htmlgit
以上是同一篇文章:GitHub+markdown+jekyll打造完美我的博客github
本文主要介绍如下几个内容:markdown
一、使用githbu建立本身的博客dom
二、将博客域名映射到本身的域名编辑器
三、使用 jekyll+markdown写做工具
1、使用github建立本身的博客url
具体可参考https://pages.github.com/spa
一、在github上建立一个repository,名称为username.github.com的形式,如lujinhong.github.comhtm
二、下载github for mac : https://pages.github.com/#setup-in-desktop,第一次运行时会提示输入github的帐户信息
三、点击github for mac左上角的+号,而后选择clone,将刚才建立的repository clone到本地。
四、选择你喜欢的编辑器,在刚才clone到本地的目录下建立index.html,文件内容为:
<!DOCTYPE html>
<html>
<body>
<h1>Hello World</h1>
<p>I'm hosted with GitHub Pages.</p>
</body>
</html>
五、打开github for mac,会发现changes那里变成了1 changes,填入comment,而后commit to master。
六、此时文件已经commit到本地库,而后unsynced那里变成了1 unsynced,点击右上角的sync,就会将内容同步到github。
七、打开页面,username.github.io,就可看到你刚才写的页面:
大功告成。
2、将博客映射到本身的域名
参考https://help.github.com/articles/adding-a-cname-file-to-your-repository/
一、到万网去购买域名,如lujinhong.com
二、在github repository根目录下新建一个叫CNAME的文件,内容以下:
lujinhong.com
固然能够是blog.lujinhong.com等二级域名,但不能有前面的http,www等前缀,也不能有/,并且文件名必须大写。
能够在github页面上直接建立文件,也可使用github for mac等工具。
三、下一步须要设置lujinhong.com指向lujinhong.github.io。到万网去设置域名解析,内容以下:
CNAME | blog | 默认 | lujinhong.lofter.com | -- | 10分钟 | 修改|暂停|删除|备注 | ||
CNAME | * | 默认 | lujinhong.lofter.com | -- | 10分钟 | 修改|暂停|删除|备注 | ||
CNAME | www | 默认 | lujinhong.lofter.com | -- | 10分钟 | 修改|暂停|删除|备注 |
好,完成了,等待几分钟,
访问lujinhong.github.io,会自动跳转到www.lujinhong.com
或者直接访问www.lujinhong.com