採用Hexo 搭建Team Blog

採用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

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 插件


已經集成的


相關文章
相關標籤/搜索