0
点赞
收藏
分享

微信扫一扫

Typora 图片上传 github

青乌 2022-05-01 阅读 68

Typora

Typora 图片上传 github

Mac 版操作

1. 安装插件

首先安装Picgo-Core, 需要有 node 的运行环境

npm install picgo -g

成功之后运行安装增强的GitHub插件

picgo install github-plus

2. 配置Github Repo

首先需要在 github 新建一个仓库, 专门用于放置自己的图片

image-20220326113243076

只需要填好正确的库名就好, 其他自由选择

image-20220326113937688

进入 settings 进行设置

在这里插入图片描述

左侧最下面有 developer settings

在这里插入图片描述

选择 new token

image-20220326114307504

里面只需要选择下面的几步就可以

image-20220326114417335

image-20220326114447330

展示一下完成后的样子

记得复制一下你的 token 它只会显示一次

在这里插入图片描述

打开~/.picgo/config.json

编写 config.json

{
  "picBed": {
    "uploader": "githubPlus",
    "current": "githubPlus",
    "githubPlus": {
      "branch": "master",
      "customUrl": "https://raw.githubusercontent.com/你的github用户名/仓库名/master",
      "origin": "github",
      "repo": "你的github用户名/仓库名/",
      "path": "img/",
      "token": "你刚刚获得的token"
    }
  },
  "picgoPlugins": {
    "picgo-plugin-github-plus": true,
    "picgo-plugin-rename-file": false
  },
  "picgo-plugin-github-plus": {
    "lastSync": "2022-03-26 11:41:42"
  }
}

3. 配置 typora

// 这是 node 的安装位置
usr/local/bin/node usr/local/bin/picgo upload 


Windows 版

1. 先配置好 github, 具体看上面 mac 版的,不做赘述

2. 然后再 typora 安装 picgo

image-20220328081359333

安装完成后, 对他进行配置

image-20220328081452027

image-20220328081536617

image-20220328082519194

3. 配置完成后进行测试

image-20220328081605552

在成功之后打开 typora 验证图片上传选项

image-20220328081359333

举报

相关推荐

0 条评论