hexo博客

github 结合 hexo 可以搭建自己的博客,具体步骤如下.

1. 安装依赖

安装node.js

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash   //https://github.com/creationix/nvm
wget -qO- https://raw.github.com/creationix/nvm/v0.33.11/install.sh | sh

 

(重启terminal)

nvm install stable
node -v

 

安装node插件(hexo)

npm install -g hexo-cli
hexo -v

 

2. 搭建blog

github上新建一个仓库,名字叫 ddddfang.github.io
//(这一步没必要)git clone git@github.com:ddddfang/ddddfang.github.io.git (使用ssh方式可以在上传了ssh公钥后不用输密码)

然后在本地

hexo init blog (then there will be a blog folder in current folder)
cd blog
npm install
npm install hexo-deployer-git --save(不install的话 下面 hexo d 部署的时候会报错)

修改modify _config.yml :

deploy:
    type: git
    repository: git@github.com:ddddfang/ddddfang.github.io.git
    branch: master

 

完成后:

hexo clean
hexo g (generate 相应的文件)
hexo d  (这一步就会将本地的blog生成的一些文件部署到github我们的仓库中)

 

浏览器访问 https://ddddfang.github.io/

2.1. 更换主题

git clone https://github.com/HmyBmny/hexo-theme-concise.git themes/concise

2.2. 上传图片

参考这里
总结就是:

1. _config.yml 的post_asset_folder 设为true
2. npm install hexo-asset-image --save   上传本地图片的插件
3. abc.md 中引用图片时, ![说明文字](abc/xxx.jpg)

 

ref

https://hexo.io/zh-cn/
https://www.jianshu.com/p/1c888a6b8297?utm_source=oschina-app
https://blog.csdn.net/hzq_0111/article/details/78956821
https://blog.csdn.net/Arisstz/article/details/80708851
https://www.cnblogs.com/fengxiongZz/p/7707568.html
https://blog.csdn.net/ainuser/article/details/77609180
https://www.zhihu.com/question/21193762

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值