修改图片地址,重新部署博客
重新部署博客
- 博客内容路径
F:\simpleai.github.io\source\_posts,修改博客中图片地址 - 在
F:\simpleai.github.io进入git bash - 执行
hexo clean - 执行
hexo g - 执行
hexo s,浏览器打开localhost:4000查看效果 - 执行
hexo d
问题
执行hexo d
1 | On branch master |
解决
生成 SSH 密钥对。在命令行中输入以下命令:
1
ssh-keygen -t ed25519 -C "your_email@example.com"
其中 “your_email@example.com“ 是您的 GitHub 账号注册时所用的邮箱地址。接着按照提示输入文件保存路径和密码等信息,或者直接按 Enter 使用默认选项。该命令将生成一个公钥文件和一个私钥文件。

将公钥添加到 GitHub 帐户。GitHub 网站依次单击 “Settings”,”SSH and GPG keys” 和 “New SSH key” 按钮。在 “Title” 字段中输入一个有意义的标识,例如 “My Hexo Blog SSH Key”,然后将公钥复制到 “Key” 字段中。最后单击 “Add SSH key” 按钮以将公钥添加到您的 GitHub 帐户中。


在 Hexo 博客的配置文件中指定 SSH URL。打开 Hexo 博客的根目录,找到
F:\simpleai.github.io\_config.yml文件并打开它。在文件中找到以下行:1
2
3
4
5deploy:
type: git
# repo: https://github.com/simpleai/simpleai.github.io.git # 代表https协议
repo: git@github.com:simpleai/simpleai.github.io.git # 代表ssh协议
branch: master将私钥添加到 SSH 代理。为了使 Git 能够使用您的 SSH 私钥进行认证,您需要将私钥添加到 SSH 代理中。在命令行中输入以下命令:
1
ssh-add ~/.ssh/id_ed25519
如果提示
Could not open a connection to your authentication agent.意味着 SSH 代理没有启动。先执行
eval "$(ssh-agent -s)",启动ssh代理再执行
ssh-add ~/.ssh/id_ed25519输入
ssh-add -l命令可以检查您的 SSH 密钥是否已添加到代理中,显示1
4096 SHA256:abc123... my_key_name (RSA)
执行
hexo d