ubuntu下使用hexo搭建博客

1 篇文章 0 订阅

1.安装Node.js

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

2.安装Git

sudo apt-get install git

3.安装hexo

 sudo npm install hexo -g

初始你博客的根目录(或者cd到指定目录下,然后执行hexo init)

hexo init <dir> 

4.让博客可以发布到git(参考连接:https://hexo.io/docs/deployment.html

(1)安装hexo-deployer-git(不然会出现ERROR Deployer not found: git)

npm install hexo-deployer-git --save

(2) 配置你hexo博客根目录下的_config.yml文件(应该是最下面一行,修改成你的github)

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:ClaymanTwinkle/ClaymanTwinkle.github.io.git
  branch: master

5.hexo常用命令

创建页面:hexo new post "文章名字(可以是中文)"

生成html : hexo generate(或者hexo g)

发布到git: hexo deploy

生成并发布:hexo generate -d (或者hexo g -d)
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值