前言:主要介紹PicGo插件,這里的圖床上傳軟件是PicGo-Core,使用命令行操作
PicGo_Path:自己的PicGo安裝路徑,如果通過Typora一般安裝位置位於C:\Users\自己的主機名\AppData\Roaming\Typora\picgo\win64
安裝以下插件前必須先安裝node.js環境
github-plus
用於支持github圖床上傳,github-plus
使用Github作為圖床使用需要先設置私人令牌:Github圖床設置
安裝插件
cd {PicGo_Path}
.\picgo.exe install github-plus
修改配置文件
{
"picBed": {
"current": "github", // 代表當前的上傳圖床
"uploader": "github",
"github": {
"branch": "master", // 分支名,默認是 master
"customUrl": "", // 沒有自己的域名的話,默認為空即可; 如果自定義域名,注意要加http://或者https://
"path": "img/", // 自定義文件存儲路徑,比如 img/ 建議填
"repo": "", // 倉庫名,格式是 username/reponame <用戶名>/<倉庫名稱> 必填
"token": "" // github 私人令牌 必填
}
},
"picgoPlugins": {
"picgo-plugin-github-plus": true // 啟用插件
} // PicGo插件
}
gitee-uploader
用於支持gitee圖床上傳,gitee-uploader
使用Gitee作為圖床使用需要先設置私人令牌:Gitee圖床設置
安裝插件
cd {PicGo_Path}
.\picgo.exe install gitee-uploader
修改配置文件
{
"picBed": {
"current": "gitee", // 代表當前的上傳圖床
"uploader": "gitee",
"gitee": {
"branch": "master", // 分支名,默認是 master
"customPath": "", // 提交消息,默認為空即可 插件默認提交的是 Upload 圖片名 by picGo - 時間
"customUrl": "", // 沒有自己的域名的話,默認為空即可; 如果自定義域名,注意要加http://或者https://
"path": "img/", // 自定義存儲路徑,比如 img/ 建議填
"repo": "", // 倉庫名,格式是 username/reponame <用戶名>/<倉庫名稱> 必填
"token": "" // gitee 私人令牌 必填
}
},
"picgoPlugins": {
"picgo-plugin-gitee-uploader": true // 啟用插件
} // PicGo插件
}
super-prefix
重命名插件,super-prefix
安裝插件
cd {PicGo_Path}
.\picgo.exe install super-prefix
修改配置文件
"picgo-plugin-super-prefix": {
"prefixFormat": "YYYY/MM/"
"fileFormat": "YYYYMMDD-HHmm"
} //super-prefix插件配置
配置參數
- prefixFormat:文件名個性前綴格式(以/結尾),
YYYY/MM/DD/
- fileFormat:文件名個性格式,
YYYYMMDDHHmmss
rename-file
重命名插件,rename-file
安裝插件
cd {PicGo_Path}
.\picgo.exe install rename-file
修改配置文件
點擊Typora里的偏好設置>打開配置文件 或 ~/.picgo/config.json
"picgo-plugin-rename-file": {
"format": "{y}/{m}/{d}/{hash}-{origin}-{rand:6}"
} //rename-file插件配置
命名規則
- {y} 年,4位
- {m} 月,2位
- {d} 日期,2位
- {h} 小時,2位
- {i} 分鍾,2位
- {s} 秒,2位
- {ms} 毫秒,3位(v1.0.4)
- {timestamp} 時間戳(秒),10位(v1.0.4)
- {hash},文件的md5值,32位
- {origin},文件原名(會去掉后綴)
- {rand:
}, 隨機數, 表示個數,默認為6個,示例:{rand:32}、{rand} - {localFolder:
}, 表示層級 ,默認為1,示例:{localFolder:6}、{localFolder}
watermark
添加水印插件,watermark
該插件下載時會下載字體,下載過程可能有點慢
安裝插件
cd {PicGo_Path}
.\picgo.exe install watermark
修改配置文件
點擊Typora里的偏好設置>打開配置文件 或 ~/.picgo/config.json
"picgo-plugin-watermark": {
"text": "jxiaow", // 水印名稱
"fontSize": 18, // 水印字體大小
"position":"rm" // 水印位置
} //watermark插件配置