教程參考
Typora+PicGo-Core(command line)+Gitee實作圖片上傳到圖床 主要借鑒 picgo 操作命令
Typora + PicGo + Gitee 實作圖片自動上傳到圖床 主要借鑒 gitee 圖床的搭建
1. node 環境準備
請自行百度解決...
2. 使用 node 安裝 PicGo-Core
// npm 命令執行速度過慢的話,我們可以使用一下淘寶的鏡像
npm install -g picgo --registry=https://registry.npm.taobao.org
// 安裝完成以后測驗一下是否安裝成功
picgo -v
3. 使用 picgo 命令安裝 gitee-uploader 插件
picgo install gitee-uploader
4. 使用 picgo 命令設定 uploader
C:\Users\Run\Desktop>picgo set uploader
? Choose a(n) uploader (Use arrow keys)
? gitee
smms
tcyun
github
qiniu
imgur
aliyun
upyun
(Move up and down to reveal more choices)
? Choose a(n) uploader gitee
? repo: xxxx/image
? branch: master
? token: 5a34fa3f348d556...
? path: 2020
? customPath: 年月
? customUrl: https://gitee.com/xxxx/image/raw/master/
[PicGo SUCCESS]: Configure config successfully!
5. 配置 Typro 上傳服務設定
重點是 自定義命令 的組成部分: [your node path] [your picgo path] upload
| 鍵 | 值 |
|---|---|
| 上傳服務 | Custom Command |
| 自定義命令 | D:\nodejs\node.exe D:\nodejs\node_global\node_modules\picgo\bin\picgo upload |
注意:配置完成后可以點擊 驗證圖片上傳選項 來測驗是否配置成功
6. 完整的組態檔
以下是參照 PicGo-Core官方檔案 的進行的配置
首先我們需要找到我們的組態檔,picgo 的默認組態檔在不同系統的目錄不太一樣:
linux 和 macOS 均為 ~/.picgo/config.json
windows 則為 C:\Users\{你的用戶名}\.picgo\config.json
{
"picBed": {
"current": "gitee",
"gitee": {
"repo": "xxxx/image",
"branch": "master",
"token": "5a34fa3f348d556...",
"path": "2020",
"customPath": "yearMonth",
"customUrl": "https://gitee.com/xxxx/image/raw/master/"
},
"uploader": "gitee",
"transformer": "path"
},
"picgoPlugins": {
"picgo-plugin-gitee-uploader": true
},
"picgo-plugin-gitee-uploader": {
"lastSync": "2020-07-30 10:29:26"
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/79408.html
標籤:其他
上一篇:WEB前端推薦書籍
