这是第一篇文章——搭建博客一二事

记录搭建博客的一些 小问题

前言:

由于好吃懒做,博客环境配置和你现在看到这篇文章已经间隔了很久,对于我这样一个没有什么经验的小白来说,最后配好环境经历了一个十分痛苦的晚上——由于我之前的乱搭!所以如果读到这里也想配置一个博客的兄弟,记得一鼓作气把博客配好,不要后面不记得自己做了什么而追悔莫及!


首先我要推荐几个我看了的非常实用的网站,其次我会列出我踩过的一些

  1. Hexo+Github初始博客配置:
    1. https://blog.csdn.net/wapchief/article/details/54602515?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5-54602515-blog-121901433.pc_relevant_3mothn_strategy_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5-54602515-blog-121901433.pc_relevant_3mothn_strategy_recovery&utm_relevant_index=10
  2. B站小白向手把手教学(强烈推荐,搭配上面第一个教程使用)
    1. https://www.bilibili.com/video/BV1aV411p7Bc/?share_source=copy_web&vd_source=5bcfe78e6c32624e336f17cbf2365a45
  3. butterfly主题官方文档(详细的主题解释,学会看文档很重要捏😊)
    1. https://butterfly.js.org/
  4. Markdown语法官方文档(别怕,看完真的不需要多久!)
    1. https://markdown.com.cn/basic-syntax/
一些坑坑坑!希望你不会碰到

1.输入’hexo d’ 指令上传代码出现如下类似报错
fatal: unable to access 'https://github.com/a956551943/a956551943.github.io/': Encountered end of file
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (/usr/local/src/hexo/hanyubolg/node_modules/hexo-util/lib/spawn.js:51:21)
at ChildProcess.emit (events.js:376:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

改用ssh密钥配置github,使用ssh链接与远程仓库建立连接,网上教程很多


2.使用ssh后 检查ssh连接情况,发现被端口22拒绝

改用443端口连接 教程网上有

3.记得hexo d是用了hexo的插件push到你在 _config.yml 文件中的repo地址,你应该在根目录下使用 git init 并建立private仓库存储你的文件,以防源码丢失

重要:不使用图床就把图片上传至博客的方法,非常简洁!!!

blog

我的版本中,在 _config.yml 只更改了如下一行

post asset folder: true

特别鸣谢:@老陈醋/冠 https://charliechen114514.github.io/

给予极大的技术帮助!!!