hexo常见问题汇总

1 Git解决“ssh:connect to host github.com port 22: Connection timed out”

在C盘路径为: c:/user/user_name/.ssh文件夹下,新建一个名称为”config”的文件

输入以下内容

1
2
3
4
5
6
Host github.com
HostName ssh.github.com # 这是最重要的部分
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

2 hexo init初始化失败

你当前文件夹下有文件存在

1

稳妥做法,在你要建立博客文件夹的目录,如:d:/, 当前目录下输入”hexo init 文件夹名称”。

3 Hexo | 支持书写数学公式

一般就是在名称为:”_config.yml”文件中,查找math关键词,修改下方的bool值

2

4 hexo引用本地图片无法显示

  1. 插件安装与配置

首先我们需要安装一个图片路径转换的插件,这个插件名字是hexo-asset-image

1
npm install https://github.com/CodeFalling/hexo-asset-image --save

打开_config.yml文件,修改下述内容

1
post_asset_folder: true
  1. 在sourse文件夹下新建一个images文件夹,用于保存图存,图片路径为:

1
images/picture_name.jpg