Typora relative path saves pictures and Gitee cannot display pictures

Table of contents

Typora relative path to save pictures

Gitee cannot display images


Typora relative path to save pictures

Step1: Modify Typora's preferences

  • Automatically create a folder named "./${filename}.assets" in the current directory
  • When pasting a picture into md, the picture will be automatically saved to the "./${filename}.assets" folder

If you create a brand new md file, then this step is over, and you can start editing freely!

Step2: Modify the old image path

Suppose you have inserted many pictures before, how to change the path again? Should we change them one by one? NO

① Select the part to be changed with the mouse:

② Shortcut key ctrl+h, replace all of them with ${filename}.assets :

Note: Of course, instead of directly writing ${filename}.assets, it needs to be replaced with the name of the directory where the pictures are actually stored.


Gitee cannot display images

When uploading the md file and image directory to Gitee together,

Open the md file and find that the picture cannot be displayed:

Try to edit md directly in Gitee and insert a picture, and found that it is a slash pot:

  • Typora uses the right slash "\" by default
  • Gitee uses a left slash "/"

So imitate Step2, replace all the right slashes "\" in the image resource path with left slashes "/", and upload it to Gitee again.


Gitee shows that the picture will be misplaced and cannot be scaled. Please find a solution TT

Guess you like

Origin blog.csdn.net/m0_64140451/article/details/132363491