安装Picgo
npm install picgo -g
which picgo # 查看picgo安装路径,我的是/usr/local/bin/picgo
配置Picgo
picgo set uploader
设置为github,输入branch为master,custom URI不用填写,其他按照创建的仓库填写。
如果还没有创建Github仓库并且设置Personal Token,去google一下就有了。
Typora设置中选择Image,Custom Command,Command填写如下
一定要保证写了node的目录和picgo的
/usr/local/Cellar/node/16.3.0/bin/node /usr/local/bin/picgo upload
顺便说一下在windows下,操作基本上是一样的,只不过直接typora安装picgo后,使用custom command,只需要picgo upload即可。配置文件一定要保证正确,填写正确uploader = github, current: github
Reference: