hexo的使用记录

记载hexo的使用记录,以及遇到的一些问题。

问题

在使用 hexo 时,遇到了一些问题,记录一下。

  1. hexo generate -d 命令报错:
1
2
3
4
warning: could not open directory '2023/11/20/开源 EDA 工具 KiCad 6.0 电路设计小书 /': No such file or directory
warning: could not open directory '2024/04/14/如何配一台电脑 /': No such file or directory
warning: could not open directory '2024/04/14/搭建属于自己的 HomeLab /': No such file or directory
warning: could not open directory '2024/04/15/小米手机折腾记录 /': No such file or directory

这里的原因一般是因为文件名中又空格,解决方法如下:

1
2
3
hexo clean
hexo new "文件名" #这里重新创建文件名
hexo generate -d
  1. git 报错:
1
2
! [remote rejected] HEAD -> main (cannot lock ref 'refs/heads/main': is at 3599f047db913b95174c1dfde585479600372b7f but expected 34ab1d64f6aafa1ae98bfec5603a92be7b4f3e6a)
error: failed to push some refs to 'github.com:ysc2/ysc2.github.io.git'

这里的解决方法是:

1
2
3
4
# 首先删除D:\blog\hexo-blog\.deploy_git文件夹
hexo clean

hexo generate -d
  1. 公钥报错

这里的解决方法就是重新配置好公钥,具体操作如下:

1
2
3
4
ssh-keygen -t rsa -C "your_email@your_domain.com"
# 多次回车,直到生成公钥和私钥

# 复制公钥到github,直接去 Github 中添加好公钥即可

hexo的使用记录
https://ysc2.github.io/ysc2.github.io/2024/06/22/hexo的使用记录/
作者
Ysc
发布于
2024年6月22日
许可协议