Typora configures gitee map bed to realize Markdown paste pictures and upload them to gitee warehouse

1. Description

For our developers, Markdown notes are an essential recording tool. When inserting pictures in our commonly used Typora, most of them insert local pictures (the pictures are saved to a local path). Every time we analyze the file, in order to ensure For the complete information of the file, you also need to share the corresponding image path (if you use an absolute path, you may have to change the reference address of each image), so using local images is quite troublesome. Next, I will show you Configure Typora as an online picture!

To realize the automatic upload and loading of pictures, we need to prepare the following points
1. Computer configuration node.js
2. Have your own Gitee account
3. Typora software

2. Preparation

2.1 Check configuration node.js

First check whether your computer has a node environment, if not, you need to install node.js
the latest version of node.js download address
node.js full version download address
Select the version you need to download, my environment v12.13.0is
node12.13.0
After downloading, follow the steps to install it.

After the installation is complete, Ctrl + Renter CMDto open the console
open console

Enter in the console node -vto view the version of node.
node version information

2.2 Configure Gitee warehouse

Log in to Gitee Gitee warehouse address If you don't have one, you need to register one.
After logging in, put the cursor on the plus sign ( +) on the right side of the top navigation bar. At this time, the following submenu will be displayed, click to 新建仓库
new warehouse
fill in your warehouse information ( the newly created warehouse is private at this time, we want to use it as a picture Warehouse, you need to modify it to be shared )
warehouse informationAfter the warehouse is built, it is empty, we can see the information (focus on it 创建git仓库)
info
in a suitable location on the computer, create a new folder with any name – as a local warehouse of the git warehouse

  • Terminal command to create folder (mkdir folder name)
    new folder
  • Use the right mouse button to create a new folder,
    new folder
    enter the folder, Shift + 鼠标右键click , 在此处打开Powershell窗口
    open terminal
    open the terminal, and enter the command to create a git warehouse in the above figure to initialize the local warehouse
# note_img1文件夹内执行一下命令
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin 你的仓库地址
git push -u origin "master"

新建文件README.md**Note:** If the touch command fails, you can choose to right click in the folder
gitpushsuccess
. At this point, it means that the gitee warehouse has been initialized!
Change the warehouse to public
, click
manage
the drop-down on the right to manage, select whether open source is open source, and check the following three promises, click Save
open source

2.3 Create a new private token

Open the gitee setting option
set upand select the left 安全设置side 私人令牌
private token
Click 生成新令牌
new tokento enter basic information (other defaults are fine), click submit
Basic Information
After submitting, your gitee account password will be verified, enter your password, and the
verify password
password will be verified. After passing the password verification, a secret key will be generated. The secret key cannot be reproduced after it is closed, so it must be kept well!
Secret key
At this point, the preparations for gitee have been completed!

2.3 Install PicGo

PicGo official document address
PicGo2.3.1 download address
PicGoDownload
Download and install!

3. Configure Typora

3.1 Open Typora's preferences

Preferences
Select the image on the left – set the upload service on the right to PicGo-Core (command line), click download or update (the download box will pop up to download relevant data)
upload serviceselect PicGo-Core (command line), click download to update PicGo.app How is it different from PicGo-Core?

PicGo.app provides a graphical interface, and PicGo-Core is only a command line mode.
PicGo-Core will only run when uploading pictures, and the process will exit after uploading; while PicGo.app will keep running

3.2 Install PicGo plugin

After the data download is successful, click the verification picture upload option, and the following prompt box will pop up (copy the path of the picgo.exe file)
Verify upload options
Validation results

Use cmd to open the above path C:\Users...\AppData\Roaming\Typora\picgo\win64 and
install it in this path

  • gitee-uploader: used to support gitee image bed upload
  • super-prefix: used to automatically rename images with timestamps when uploading them.
    Run the following command:
 .\picgo.exe install gitee-uploader
 .\picgo.exe install super-prefix

gitee-uploader

3.3 Configure PicGo

Typora --"Preferences--"Images--"Upload Service Settings--"Open the configuration file
open configuration fileand configure as follows:

{
    
    
  "picBed": {
    
    
    "current": "gitee", # 代表当前的图床
    "uploader": "gitee",
    "gitee": {
    
    
      "branch": "master", # 分支名,默认是master
      "customPath": "",
      "customUrl": "",
      "path": "imgs/", # 自定义存储的图片路径
      "repo": "gitee账户名/仓库名称", # 必填
      "token": "8ca86da8fe753a3a5c420a65128e46c7s" # gitee的私人令牌
    }
  },
  "picgoPlugins": {
    
    
    "picgo-plugin-gitee-uploader": true,
    "picgo-plugin-super-prefix": true
  },
  "picgo-plugin-super-prefix": {
    
    
    "fileFormat": "YYYYMMDDHHmmss"
  },
  "picgo-plugin-gitee-uploader": {
    
    
    "lastSync": "2023-03-07 01:23:35"
  }
}

3.4 Verify whether the configuration is successful

Typora--"Preferences--"Image--"Upload Service Settings--"Click to verify the image upload option. If
Verification successful
such a result appears, it proves that the configuration is successful!

3.5 Configure automatic upload of inserted pictures

Typora --"Preferences--"Image--"When inserting a picture,
it is configured to upload a picture, check the information in the picture below , and Typora configures the gitee image bed to realize Markdown paste the picture and upload it to the gitee warehouse . If this article is
upload imagehelpful to everyone
Helpful, you can support and pay attention, (summary of personal experience, if there is a better way, you can comment and leave a message to communicate!)
祝大家的技术日日新,苟日新!

Guess you like

Origin blog.csdn.net/qq_42320934/article/details/129375850