Typora+PicGo+GitHub图床配置
1.下载Typora
官网下载:https://typora.io/
2.下载PicGo
GitHub下载地址:https://github.com/Molunerfinn/PicGo/releases
3.GitHub设置
在GitHub上创建一个仓库,用来作为图床。
创建仓库
填写仓库名,点击create repository,进行创建仓库:
获取token
点击自己的头像,选择settings,选择Developer settings进入以下界面,按照图中步骤点击生成token
给token命名,保存好token,后面无法再查看;
4.配置PicGo
下载安装好PicGo,打开配置GitHub信息;
然后点击PicGo设置,打开时间戳重命名,这样可以避免上传图片时出现重名而造成错误;
测试PicGo
点击进入上传区,将图片拖入上传区域,测试是否上传成功;在上传时进度条都是蓝色的,即上传成功;如果出现以下错误,则有可能是输入的仓库名包含空格导致,去掉空格后,重新测试即可。测试成功后就可以开发配置Typora啦。
5.配置Typora
打开Typora,在文件里选择偏好设置,选择图像,PicGo路径选择之前安装的PicGo位置;然后点击验证图片上传选项;
上传成功如下图所示:
6.图片上传成功不能正确展示解决
解决方法,用管理员身份打开路径C:\Windows\System32\drivers\etc下的hosts文件,在文件末尾加上如下配置:
# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
# GitHub End
保存,重新打开Typora图片就可以正常展示啦!