如何使用 gitea 作为 typora 的图床?

注意
本文最后更新于 2025-01-11,文中内容可能已过时。

如何使用 gitea 作为 typora 的图床?

  1. 到 PicGo 官方 github 仓库的 release 下载对应平台的安装文件 (选择有 latest 标签的), 并进行安装(这里以 Windows 11 为例,安装过程省略)

    PicGo

  2. typora 配置 PicGo 的路径

    1. 打开 typora 软件,点击菜单栏的文件。

    image-20220326211755455
    image-20220326211755455

    ​ 2. 找到偏好设置(由于这个界面我截不了图所以这里就不放图了),点击箭头所指的文件夹。

    image-20220326212023263
    image-20220326212023263

    1. 选择 picgo 程序

      image-20220326212250031
      image-20220326212250031

  3. 打开 PicGo,下载 gitea 插件。

    image-20220326212449573
    image-20220326212449573

  4. 创建 gitea 仓库,并完成第一次 push

    image-20220326214020556
    image-20220326214020556

    image-20220326214147688
    image-20220326214147688

    image-20220326214559116
    image-20220326214559116

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    
    # 复制上面的代码,相应的调整一下
    mkdir img
    cd img
    mkdir img
    cd img
    touch README.md
    cd ..
    git init
    git add .
    git commit -m "first commit"
    git remote add origin https://example.com/你的用户名/img.git
    git push -u origin master
  5. 配置 gitea 插件,找到图床设置,打开 Gitea Img 进行配置。

image-20220326212652117
image-20220326212652117

1
2
3
4
5
URL			你gitea的域名,例如:https://example.com/
Usernaem	你gitea的用户名,例如:test
Repository	你gitea上用来存放图片的仓库名,例如:img
Token		参照下面的方法生成,然后复制粘贴上去
Path		仓库的相对路径,非填项,你也可以填,我就填img,你的仓库必须存在这个路径才可以填

image-20220326213257477
image-20220326213257477

image-20220326213206718
image-20220326213206718

image-20220326213419078
image-20220326213419078

然后确认,也可以设为默认图床(建议设置)

image-20220326213552467
image-20220326213552467

  1. 最后验证一下配置。

    image-20220326215435459
    image-20220326215435459

image-20220326215703868
image-20220326215703868

出现这个配置就没有什么问题。

  1. 最后配置一下上传规则就可以了,然后粘贴图片到 typora 就会自动上传的 gitea 了。

    image-20220326215842447
    image-20220326215842447

enjoy!

Buy Me a Coffee ~~
hiifong 支付宝支付宝
hiifong 微信微信
0%