introduction
Since gitee has now added an anti-leech link and only supports 1M pictures, some pictures of Typora may not be displayed (sm.ms seems to be fine, github network speed is not stable, you can buy Tencent Cloud or Alibaba Cloud, etc.)
In principle, markdown does not recommend using base64 embedded images, because it is too troublesome.
If you are only browsing and editing locally, you can use a relative or absolute path, but considering the need to publish and share, using a picture bed is a better solution.
This tutorial can quickly get a relatively stable free image bed, does not require a registered domain name, and is relatively stable among the free image beds.
The following is a comparison between GitHub and SM.MS as a personal free image bed,
Due to indescribable reasons, the access speed of GitHub in China is not very stable, and SM.MS is a free image bed project launched by V2EX boss @Showfom in 2014. Currently, the access speed in China is relatively fast, and occasionally it may not be available In this case, the personal free quota is 5G.
It is faster and more stable to visit gitee in China. The following uses Gitee to build (Github and SM.MS map bed can be built in this article: Use of GitHub&SM.MS map bed ).
1. Configure Gitee and get token
register
Enter Gitee official website: workbench-Gitee.com registered account
new warehouse
Used to save pictures uploaded by Typora
Fill in all kinds of information, and pay attention to the warehouse name not to have capital underscores like the following
Change the warehouse to open source after the new creation is complete
generate token
Remember to save the token after it is generated, it will not appear again later
2. Install PicGo
This is an open-source tool for local image upload and image bed management. It supports markdown, html, url and other formats. Address: https://github.com/Molunerfinn/PicGo/releases , just select the corresponding version to download, such as windows Select PicGo-Setup-2.2.2.exe for the version, skip the installation process.
3. Install Node.js
Install node.js in https://nodejs.org/zh-cn and select the long-term support version.
Verify installation:
node -v
If the version number appears, it means success
4. Install the gitee plugin in picgo
Search for gitee in the plug-in settings on the left side of picgo, and you will find that it cannot be installed, or there is no response
Manually install the PicGo plugin
First make sure to install Node.js, Win+R key, enter cmd to call the command line window, enter npm -v to display the version number, indicating that you can use npm
Then go to the windows configuration directory in C:\Users\XXX\AppData\Roaming\picgo , XXX is the user name of the computer, you can modify it according to your own situation
cd C:\Users\XXX\AppData\Roaming\picgo
Finally, in this directory, use npm to manually install the gitee image bed, the command is as follows:
npm install picgo-plugin-gitee-uploader
Then restart picgo.
5. Configure PicGo
Click on gitee on the left to enter – edit
enter:
username/warehouse name
The previously generated token
storage folder
Set as the default drawing bed after completion
Finally, set typora as follows
Then click the verify image upload option to test whether the upload is successful