使用GitHub作Free图床

一、方法原理

  1、使用GitHub的Issues问题功能。

  新建一个Issues问题请求

  将图片拖拉或者上传到问题框后,会返回一个地址,这个地址就是图片直链

  

  2、通过访问github仓库内的图片地址并进行修改

例如我的image-host仓库,地址是:https://github.com/wangchuanli001/image-host/tree/master/imgtemp

对于对应的图片,例如snowtree.jpg

https://github.com/wangchuanli001/image-host/blob/master/imgtemp/snowtree.jpg(原地址)

进行更改后(可以作为直链访问):

https://github.com/wangchuanli001/image-host/blob/master/imgtemp/snowtree.jpg?raw=true

https://github.com/wangchuanli001/image-host/raw/master/imgtemp/snowtree.jpg

 二、拓展

  对于图片的上传只要记录下上传的文件路径以及文件名,就可以免费使用github作为图床使用了。

猜你喜欢

转载自www.cnblogs.com/null-/p/10051036.html
今日推荐