ubuntu下使用hexo搭建博客

来源:互联网 发布:淘宝金牌卖家在哪 编辑:程序博客网 时间:2024/04/28 08:45

1.安装Node.js

sudo add-apt-repository ppa:chris-lea/node.jssudo apt-get updatesudo 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.htmldeploy:  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 0
原创粉丝点击