花了1小时来写这篇文章,制作不易,评论一下吧。
准备工作
设置Token
首先,新建一个仓库
不要勾选 “Private”。勾选了就不可以当图床了
然后去设置 Token,点你的”头像”(虽然我这里是显示不出来),然后点击”Settings”
选择Developer settings.
接着选择Personal access tokens
新建一个Token
弄完以后你会得到一个Token,记得保存好!这个Token只出现一次!刷新了就没了
配置PicGo
打开PicGo官网下载一个最新的PicGo
安装完打开,设置一波。
先把Github的设置给弄下,要输入你的仓库,和分支(直接输入”Master”就ok了),然后是Token.
然后把 Server 给关闭,不然的话上传不了图片
然后就可以了。
使用Images
创建 Release
上传完图片就要创建一个版本,也就是”Release”。
使用图片
打开PicGo,打开相册,点击那个小纸张,也就是图片下面的小纸张。
弄完以后在你的文章嵌入
!(名字)[https://cdn.jsdelivr.net/gh/用户名/仓库/图片]
如果无法显示的话还有2种备用方法:
!(名字)[https://cdn.jsdelivr.net/gh/用户名@master/仓库/图片] !(名字)[https://cdn.jsdelivr.net/gh/用户名@版本号/仓库/图片]
然后预览一下,发现图片就成功了。
参考文章
PicGo + GitHub 搭建个人图床工具_运维_魔法学徒-CSDN博客
GitHub+jsDelivr+PicGo搭建快速免费图床 - Rogn - 博客园