大家好,几个月前,我申请了一个域名,然后用hexo生成静态页面并部署到github,参考网上教程,做了我的博客。后来我把Hexo的文件专门备份了,然后电脑系统重装。
现在我写了文章准备再次更新。就重新配置等等,现在本地可以预览,有新文章等等的,但hexo d部署却提交不上github。导致我的网站也就无法更新了。
明明已经把新文章放进post文件了,public文件里也有新文章,本地hexo s,预览也是可以的。自己的域名也是放在source目录下的cname里的。之前都是可以的,现在重新配置就不行了。nothing to commit, working directory clean。。。
这是hexo d之后的显示。
这是根目录下config配置,git和github,https,http,@git什么的都试了。
删除 .deploy_git目录,再执行 hexo d -g就可以了
如果报错 没有master 如下:
root@756242cbe446:/he/blog_source# hexo d INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... On branch master nothing to commit, working tree clean Counting objects: 467, done. Delta compression using up to 2 threads. Compressing objects: 100% (273/273), done. Writing objects: 100% (467/467), 906.27 KiB | 0 bytes/s, done. Total 467 (delta 155), reused 0 (delta 0) remote: Resolving deltas: 100% (155/155), done. remote: Powered by GITEE.COM [GNK-5.0] To gitee.com:horysk/horysk.git + cff865e...ef1f6bc HEAD -> master (forced update) Branch master set up to track remote branch master from git@gitee.com:xxxxxx/xxxx.git. On branch master nothing to commit, working tree clean fatal: 'master' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: Spawn failed at ChildProcess.(/he/blog_source/node_modules/hexo-util/lib/spawn.js:51:21) at ChildProcess.emit (node:events:376:20) at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
把Deployment改为
# Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repository: git@gitee.com:xxxxx/xxxx.git
hexo 安装搜索功能
npm install hexo-generator-searchdb --save
查看 /themes/next/_config.yml 配置
- 搜索 local_search看看这个下面的enable 是否处于
local_search: enable: true
查看添加配置(这个我个人觉得嘛加和不加没有区别)
- 添加 /themes/next/_config.yml
search: path: search.xml field: post format: html limit: 10000
npm install hexo-deployer-git --save