Pratical method to insert images into a new post

My clean and cute desktop :)
desktop.PNG

So how to insert a picture which you like into a post.


Set post_asset_folder in /_config.yml

1
post_asset_folder: true

Hexo will create a folder every time you make a new post. This asset folder will have the same name as the markdown file associated with the post. Place images you want to into the associated folder.


Tag Plugins For Relative Path Referencing

1
2
3
{% asset_path slug %} # display path
{% asset_img slug [title] %} # display image
{% asset_link slug [title] %} # display link

Certainly, I can code where I want to insert an image like this:

1
{% asset_img desktop.PNG %}

Notes: Don’t forget the file suffix and do not change the case of the images name.
Thanks to: Asset Folders on Hexo Docs