avatar

利用码云和hexo搭建博客

以前再GitHub上搭建过一次,但是太慢了,这次就搭建再gitee上了,国内快太多了

之前搭建的博客也特别简陋,这一次也努力美化一下

本文总结搭建过程中的一些坑:

坑点一:Nodejs和Git的下载

我本来想的是取官网下载的,但是下载的速度十分感人,不建议官网下载

https://blog.csdn.net/weixin_43606158/article/details/100609856

去上述网址下载,1到2分钟就下载完毕了

git config --global user.name "yourgithubname"
git config --global user.email "yourgithubemail

坑点二: npm安装hexo

nmp install -g hexo-cli  //默认的源也是一样下载不动

//解决方法:换源
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

//再执行
nmp install -g hexo-cli //飞速安装

坑点三:我选的主题butterfly

#1. 没有cheerio
npm install cheerio@0.22.0 --save //如果使用cpnm可能更快

#2. 需要安装pug以及stylus的渲染器,安装速度有点慢耐心等待
npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive

#3 解决完这两个坑之后
hexo clean
hexo g
hexo s //看下效果

坑点四 配置git和部署

url: https://vccyb.gitee.io/myblog
root: /myblog/

deploy:
type: git
repo: https://gitee.com/vccyb/MyBlog.git
branch: master

坑点五 公钥

ssh-keygen -t rsa -C "xxxxx@xxxxx.com"  //产生公钥

npm install hexo-deployer-git --save
hexo d
pie title Key elements in Product X "Calcium" : 42.96 "Potassium" : 50.05 "Magnesium" : 10.01 "Iron" : 5
文章作者: Chen
文章链接: https://vccyb.gitee.io/myblog/2020/03/18/article/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 东川
打赏
  • 微信
    微信
  • 支付寶
    支付寶

评论