Hexo 搭建博客碰到的常见问题

本人用的是 Hexo 3.1

上传报错

问题:上传文件报错误

1
2
warning: LF will be replaced by CRLF in xxx.
The file will have its original line endings in your working directory

分析:Git 操作时,文件中的换行符有差别导致报错

解决:在克隆下的路径输入:

1
2
3
4
git rm -r --cached .
git config core.autocrlf false
git add .
git commit -m ''

生成报错

问题:输入命令call hexo d -g报错

1
2
YAMLException:end of the stream or a document separator is expected
YAMLException:name of an alias node must contain at least one character at

解决:在你的 MarkDown 中添加头部信息,比如

1
2
3
4
5
6
---
title: Hexo 生成报错
data: 2019-11-28 14:38:14
permalink: Hexo 生成报错
tags: 编程语言
---

评论