工具-github+typora+PicGo图床

github图床

github

  1. 获取tokens
  • 设置Note,选择repo, Generate token生成token,复制生成的token(只显示一次)

    image-20210825202513498

image-20210825202741003

image-20210825203131917

Typora

window

  1. 下载PicGo-Core(好像需要安装node)
  • 偏好设置 , 图像,PicGo-Core,下载或更新,下载完后点击验证图片上传(查看位置)

image-20210825204041755

image-20210825204422037

  1. 安装github-plus插件
1
2
3
4
# 转到picgo位置
cd C:\Users\26634\AppData\Roaming\Typora\picgo\win64
# 安装github-plus
./picgo install github-plus
  1. 配置
  • 回到typora, 打开配置文件(C:\Users\你的用户名\.picgo\config.json),设置如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"picBed": {
"uploader": "githubPlus",
"current": "githubPlus",
"githubPlus": {
"branch": "master",
"customUrl": "https://cdn.jsdelivr.net/gh/用户名/仓库",
"origin": "github",
"repo": "用户名/仓库",
"path": "保存路径/",
"token": "上面创建的token"
}
},
"picgoPlugins": {
"picgo-plugin-github-plus": true
}
}
  • https://cdn.jsdelivr.net/gh/用户名/仓库 cdn加速访问
  1. 上传的时候重命名
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 查看源
npm config get registry

# 没有使用淘宝源的直接安装
./picgo install rename-file

# 下面是使用了淘宝源的
# 1.临时使用
npm --registry https://registry.npmjs.org/ install express
picgo install rename-file


# 2. 换回初始源安装后再换回淘宝源
npm config set registry https://registry.npmjs.org/
picgo install rename-file
npm config set registry https://registry.npm.taobao.org
  • 打开配置文件在最后添加
1
2
3
"picgo-plugin-rename-file": {
"format": "{y}-{m}-{d}/{timestamp}"
}
  • 验证图片上传

Linux

  • 安装picgo
1
npm install picgo -g
  • 安装github-plus
1
picgo install github-plus
  • 安装rename-file插件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 查看源
npm config get registry

# 没有使用淘宝源的直接安装
./picgo install rename-file

# 下面是使用了淘宝源的
# 1.临时使用
npm --registry https://registry.npmjs.org/ install express
picgo install rename-file


# 2. 换回初始源安装后再换回淘宝源
npm config set registry https://registry.npmjs.org/
picgo install rename-file
npm config set registry https://registry.npm.taobao.org
  • 配置文件(位置:~/.picgo/config.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"picBed": {
"uploader": "githubPlus",
"current": "githubPlus",
"githubPlus": {
"branch": "master",
"customUrl": "https://cdn.jsdelivr.net/gh/用户名/仓库",
"origin": "github",
"repo": "用户名/仓库",
"path": "保存路径/",
"token": "上面创建的token"
}
},
"picgoPlugins": {
"picgo-plugin-github-plus": true,
"picgo-plugin-rename-file": true
},

"picgo-plugin-rename-file": {
"format": "{y}-{m}-{d}/{timestamp}"
}
}
  • 在typora中:选择图像 - 上传服务 - Custom Command - picgo upload

image-20210926192725468