当前位置: 首页> 教育> 就业 > 工具-博客搭建

工具-博客搭建

时间:2025/8/19 12:52:03来源:https://blog.csdn.net/sgliquangang/article/details/139143576 浏览次数:0次
以下相关讲解均基于hexo + github pages方案,请注意!!!

博客搭建方案选择

  • 参考文章1

搭建教程

  • 参考文章1

hexo + github pages搭建过程中遇到的问题

删除categories、tags

1、删除含有需要删除categories、tags的文章
2、hexo clean
3、hexo s
4、hexo g

Support for password authentication was removed on August 13, 2021. Please use a personal access token instead
  • github 不再支持password,必须使用Personal access tokens
    • 参考文章1
No layout: index.html
  • 可能是主题未正确安装的问题
    • 安装主题参考
fatal: in unpopulated submodule ‘.deploy_git’
  • 删除.deploy_git(rm -rf .deploy_git/),然后重新hexo d
git push 需要输入用户名密码问题
  • 需要改成token方式:
    • git remove -v: 查看当前origin配置
    • git remote remove origin:移除origin配置
    • git remove -v:再次查看origin配置
    • git remote add origin https://你的token@github.com/liquangang/liquangang.github.io.git
    • git remote -v:查看是否修改成功
hexo d 推动失败
  • 一种可能:依然是git配置问题,需要修改_config.yml文件中的git配置(deploy->repo),此处与git的正常配置一样,即设置origin(举例:https://你的token@github.com/liquangang/liquangang.github.io.git)
  • 另一种可能: 代码库地址配置的是http格式,换成ssh格式,然后重新配置一遍ssh key就行了(伤心&激动,搞了好久,一直在搞http格式的,一直没成功,不过我觉得http的也行,因为之前我用的就是http格式,不知道这次为什么不行了,总之现在确定ssh形式可以)
hexo clean 等提示 node-sass问题
  • 参考文章
  • 原因:node源不稳定
  • 解决:切换国内源(npm install -g cnpm --registry=https://registry.npm.taobao.org),然后使用cnpm命令执行操作
err: Error: Spawn failed
  • 解决:
    • 删除.deploy_git目录
    • git config --global core.autocrlf false
    • hexo clean && hexo g && hexo d
Node Sass could not find a binding for your current environment
  • node跟npm的版本不对应问题,尝试重新安装即可
sudo cnpm install hexo-renderer-sass --save 执行失败
  • 删除目录下的package.json 重试即可
显示can not get /
  • 执行sudo cnpm install 即可
Cannot read properties of undefined (reading ‘enable’)
  • 删除主题git文件,重新clone一份
hexo landscape 主题 本地搜索功能
  • 参考文章

技巧

如何保存原始文章:
  • 目前笔者采用的方式是,在github上新建一个专门用来保存原始文章的分支,然后将原始文章push到这个分支上
  • push脚本:
        hexo clean;git add .;git commit -m "博客文章更新";git push;hexo g;hexo d;hexo clean;
    
关键字:工具-博客搭建

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: