GitHub+PicGo+jsDelivr+Typora 搭建免费图床

Github 仓库

  1. 创建仓库
    image-20220112204447287

  2. 创建密钥
    直接访问 https://github.com/settings/tokens, 点击 Generate new token 按照下图配置创建即可。

只需要勾选 repo

image-20220112204633150
3. 保存密钥
创建成功后不要刷新页面,密钥只会出现一次请妥善保存!
image-20220112204547970

PicGo

APP

  • windows&Linux&Mac
    https://github.com/Molunerfinn/picgo/releases
  • ArchLinux
    1
    yay -S picgo-appimage

    PicGO-Core

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    {
    "picBed": {
    "uploader": "minio",
    "current": "minio",
    "minio": {
    "endPoint": "minio.fungs.cn",
    "port": "9000",
    "useSSL": true,
    "accessKey": "用户名",
    "secretKey": "密码",
    "bucket": "picture",
    "sameNameFileProcessingMode": "覆盖",
    "baseDir": "images/typora",
    "customDomain": "https://minio.fungs.cn",
    "isAutoArchive": false
    },
    "transformer": "path"
    },
    "picgoPlugins": {
    "picgo-plugin-minio": true
    }
    }

PicGO-Cli

Linux 需要使用 Cli 工具,Windonws 则不需要

1
sudo npm install -g picgo
  1. 设置图床信息
1
picgo set uploader
  • 设定仓库名:按照【用户名 / 图床仓库名】的格式填写
  • 设定分支名:【 main 】 2021 年后 master 改为 main
  • 设定 Token:粘贴上述生成的【 Token 】
  • 指定存储路径:如【 images/ 】,这样就会在仓库下创建一个名为 images 的文件夹,图片将会储存在此文件夹中
  • 设定自定义域名:它的的作用是,在图片上传后,PicGo 会按照【 自定义域名 + 上传的图片名 】的方式生成访问链接,放到粘贴板上,因为我们要使用 jsDelivr 加速访问,所以可以设置为 https://cdn.jsdelivr.net/gh/likfees/Picture

image-20220112203726795

  1. 使用图床

    1
    picgo use uploader

    image-20220112203818797

  2. 验证

命令行
image-20220112203626864

Typora

设置 -> 图像 设置 PicGo 配置

1
picgo upload

image-20220112203557267

image-20220112203659848