搭建github博客指导

我的github仓库地址: https://github.com/Donaldhan/Donaldhan.github.io
github blog: https://donaldhan.github.io/
本文不打算一步一步的的讲如何搭建博客,有兴趣的可以参见我的github的wiki说明:
https://github.com/Donaldhan/Donaldhan.github.io/wiki/%E4%B8%AD%E6%96%87%E6%89%8B%E5%86%8C
和我搭建博客的笔记,上面有相关的知识点资源链接。

https://gitee.com/Donaldhans/draft/blob/master/git-page-blog.md

我们要讲的是GitHub Pages + jekyll所使用的相关技术概念,让你对GitHub Pages + jekyll创建的博客有一个整体上的把握。创建博客,说的直白一点,首先创建的github Page仓库,仓库名为 youName.github.io,然后添加Jekyll主题,然后在仓库的 _post文件夹下,
写markdown格式的文章,文件标题格式为:

YYYY-MM-DD-title.md


日期加文章标题。

然后浏览一下站点:
https://youName.github.io/

即可看见你的博客。

站点的内容是由Jekyll自动生成的。

那jekyll是什么?个人理解,jekyll是基于Ruby的将资源文件转换为站点的工具。另外对于jekyll,必须知道的一点是,模板引擎[Liuqid],Liuqid对于jekyll,犹如jsp和freemaker对于html一样,但更像freemaker。可以引用网站的数据,同时拥有逻辑判断和循环语法。在创建jekyll博客时,你可能会用两种文件格式,分别为 yaml和 markdown,yaml是一个友好的数据序列序列编程语言,类似json,但比json更简单,用于配置文件。markdown是一种易读易写的纯文本标记语言,不像xml和html那样繁琐,每个元素必须有开始和结束name标记,markdown精选了一些特殊的符号做为标记,markdown同时兼容html语言。浏览器解析markdown文件时,实际解析为html语言。如果你想编辑markdown语言,你可以使用Atom , MarkdownPad两个编辑软件,atom是github官方markdown编辑软件,有linux和window版本,MarkdownPad也不错,但只适用windows系统,建议使用atom。markdown用户撰写文章。  在了解上面的知识后,创建一个可以发布文章的博客,已经没有什么问题了,当文章发布量增大时,如何快速查看以前的文章了,这就用到的全文搜索了,这个我们可以用基于liquid的tipue search。有了搜索,还有一点,不能发布过文章,就没有事,如果与读者交流才是最重要的,这个我们可以使用基于github issue的评论插件gitalk。到这里,一个完整的博客该有的功能相关知识点已经基本了解,Just play, hava fun, enjoy the game...。

Jekyll:
官方网站: http://jekyll.com.cn/
中文网站: https://jekyllrb.com/
yaml: http://www.yaml.org/
markdown: https://daringfireball.net/projects/markdown/syntax
Liuqid: https://help.shopify.com/themes/liquid/basics
MarkdownPad: http://markdownpad.com/
Atom: https://atom.io/
tipue-search: https://github.com/jekylltools/jekyll-tipue-search
gitalk: https://github.com/gitalk/gitalk

猜你喜欢

转载自donald-draper.iteye.com/blog/2399266