採用Hexo 搭建Team Blogcss
首先你要会使用Git 已经GitHub,而后让咱们了解下什么是静态Bloghtml
静态博客是指 不需要数据库驱动,拥有丰富模板,经过模板标记语言生成简单html css静态内容形式的博客。node
常常使用的静态Blog生成器有例如如下几种:git
jekyll http://jekyllcn.com/ rubygithub
octopress http://octopress.org/ 数据库
hexo http://hexo.io/ nodejs npm
ghost https://ghost.org/ json
Dropbox + MarkDown = Blog, FarBox!ubuntu
GitHub 和 DigtalOcean 近期提供了一个优惠政策,所有有.edu 邮箱的都可以免费申请100美圆,好机会不容错过,详情看博主的另外的帖子ruby
http://blog.csdn.net/jackrex/article/details/40071353
採用的标记性语言 MarkDown 编写blog。
http://wowubuntu.com/markdown/
这里採用Hexo来生成静态Blog
參考文档 http://hexo.io/docs/index.html
安装:
what’s npm
NPM nodejs packager manager nodejs 包管理器
接下来開始在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。
已经集成的