Hexo-mac下搭建hexo博客全过程

http://ibruce.info/2013/11/22/hexo-your-blog/ (目前为止最全的一篇)

http://www.it165.net/os/html/201406/8604.html

http://yangjian.me/workspace/building-blog-with-hexo/ (重点)

http://blog.fens.me/hexo-blog-github/

http://www.aips.me/hexo-independent-blog-new-ways.html (config 配置)

http://www.jianshu.com/p/b52081837f73 (多说配置)


先屡一下思路
1.首先hexo是基于nodejs的,所以必须安装nodejs
2.安装nodejs方法很多,我选择homebrew安装方式,所以需要安装它
3.安装homebrew就很简单了,mac自带ruby脚本功能,一句话搞定
4.hexo提交部署github需要使用git工具,所以需要安装git,用homebrew的话也是一句话搞定
5.OK整理一下安装顺序(homebrew-nodejs-hexo-git)

思路屡清楚了,下面安装方法整理一下
1.安装brewhome,一句话搞定

1. ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”

2.0 安装nodejs
2.1 第一种方式,brewhome安装,一句话搞定

1. brew install node

2.2 第二种方式,前提是已经安装好Xcode和git,安装git方法在下面介绍

1. git clone git://github.com/joyent/node.git
2. cd node
3. ./configure
4. make
5. sudo make install

2.3 第三种方式,下载源码(http://nodejs.org/download/),编译执行同上

3.0 安装hexo
3.1 第一种方式,用nodejs自带npm安装

1. npm install -g hexo
2. hexo init
3. npm install

3.2 第二种方式,下载源码(http://www.nodejs.org/download/),编译执行

4.0 安装git
4.1 第一种方式,homebrew安装,一句话搞定
sudo brew install git
4.2 第二种方式,前提是已经安装好Xcode

1. curl -O http://kernel.org/pub/software/scm/git/git-1.7.5.tar.bz2
2. tar xjvf git-1.7.4.1.tar.bz2
3. cd git-1.7.4.1
4. ./configure --prefix=/usr/local
5. make
6. sudo make install
7. which git

4.3 第三种方式,下载源码(https://www.kernel.org/pub/software/scm/git/),编译执行同上
4.4 第四种方式:图形界面安装OpenInGitGui(https://code.google.com/p/git-osx-installer),但是天朝被墙
4.5 配置
4.5.1 检查SSH key

1. cd ~/.ssh

4.5.2 备份已有的key,(如果有的话)

1. mkdir key_backup
2. mv id_rsa* key_backup

4.5.3 生成SSH key

1. ssh-keygen -t rsa -C "xxxx@xxxx.com”

4.5.4 将SSH key添加到Github
登录到GitHub页面,Account Settings->SSH Public Keys->Add another key将生成的key(id_rsa.pub文件)内容copy到输入框中,save。
4.5.5 测试连接

1. ssh git@github.com

4.5.6 设置个人信息

1. git config --global user.name "treason258”
2. git config --global user.email ma.tengfei2008@163.com

5 修改hexo根目录下_config.yml文件(xxxx为你的github账户名称)

1. deploy:
2. type: github
3. repo: git@github.com:xxxx/xxxx.github.io.git
4. branch: master


6 注册github账号,新建名为xxxx.github.io的repository

7 到这,Hexo博客搭建已经完成了,并且可以git提交到github上,通过访问xxxx.github.io就可以访问本博客,关于hexo的一些操作以后有时间再整理吧


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值