採用Hexo 搭建Team Blog

採用Hexo 搭建Team Blog



首先你要会使用Git 已经GitHub,然后让我们了解下什么是静态Blog



静态博客是指 不须要数据库驱动,拥有丰富模板,通过模板标记语言生成简单html css静态内容形式的博客。


经常使用的静态Blog生成器有例如以下几种:

jekyll http://jekyllcn.com/  ruby

octopress http://octopress.org/

hexo  http://hexo.io/   nodejs

ghost  https://ghost.org/

Dropbox + MarkDown = Blog, FarBox!


GitHub 和 DigtalOcean 近期提供了一个优惠政策,全部有.edu 邮箱的都能够免费申请100美元,好机会不容错过,详情看博主的另外的帖子

http://blog.csdn.net/jackrex/article/details/40071353


採用的标记性语言 MarkDown 编写blog。

http://wowubuntu.com/markdown/

这里採用Hexo来生成静态Blog

Hexo

參考文档 http://hexo.io/docs/index.html


安装:


what’s npm


NPM nodejs packager manager  nodejs 包管理器


正式開始,生成Blog


接下来開始在Github建立个repo 仓库,名字命名为 teamname.github.com (team  是你团队名称)。















package.json  npm 配置文件





_config.yml  hexo 配置文件





hexo help 让我们看看hexo的经常使用命令



接下来開始生成我们的blog

hexo init

hexo g (generate)

hexo s (server)

it works !!


激动人心的时候可到了,赶快訪问http://localhost:4000/





在_config.yml 配置好我们的github地址

hexo deploy 上传到我们的github 上


訪问 http://alloyteammobile.github.io/

我擦,这什么情况?


网址解析要等大约半个小时,骚年等等吧。

很多其它主题


界面太丑了,来换换别的主题吧。

这里有很多其它地主题选择

https://github.com/tommy351/hexo/wiki/Themes

把须要的主题克隆到本地的themes中

改动 _config.yml  中的theme


让我们在一次激动人心的訪问 http://localhost:4000/

这又是啥情况??


好吧,须要安装EJS解析模板


https://github.com/tommy351/hexo/releases/tag/2.6.0


运行例如以下命令



再次打开 http://localhost:4000/ 。 It Works!!!!



赞赏下主题

hexo clean
hexo generate
hexo deploy


























有的时候使用一些主题会遇到一些问题,比方:



YAML parser was changed in Hexo 2.8. You have to wrap strings like this with quotation marks.

archive_b: Archives: %s => archive_b: "Archives: %s"




Edit all of the yml file in the language folders of thirdparty theme , add quotation marks when there is a space between the values.





这里须要把全部模板中的archive_b: Archives: %s => archive_b: "Archives: %s"

加啥双引號,不然会解析错误。




好的Blog好的文章当然要和大家互动哈,集成我们的评论系统,Disqus 或者多说,我们临时用多说吧。






详细使用參考官网文档非常easy。

正式開始写Blog。




























hexo 插件


已经集成的


posted @ 2015-03-29 16:42  mfrbuaa  阅读(297)  评论(0)    收藏  举报