hexo + gitee部署博客

前提:创建码云账号、安装了node.js 与git

   1. 安装hexo 框架

npm install -g hexo-c

2.hexo init 文件名(或者以创建相应文件在该文件下cmd 中 hexo init)

3.hexo -g 本地生成静态文件
hexo server 运行
4.上传到gitee 搭建远程可访问博客
4.1 创库创建后:
复制URL,到hexo的配置文件_config.yml

 deploy:
  type: git				# type为git
  repo: https://gitee.com/somata/somata	# 仓库的URL
  npm install hexo-deployer-git --save	# 安装git插件
  git config --global user.email *********@qq.com	# 设置gitee邮箱(gitee的注册邮箱)
  git config --global user.name '****'			# 设置用户名(git的注册昵称)
  hexo deploy -g (hexo d -g) # 上传到gitee
  # 在上传时,需要再次输入gitee的注册邮箱作为username,账户密码作为password
4.2 上传完成后
服务 - gitee pages

爬坑指南:
1.样式图片不显示:
修改配置文件_config.yml如下
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://octobering2.gitee.io/myhexoblog
root: /myhexoblog/


 
 
原文地址:https://www.cnblogs.com/2Octobering/p/13499719.html