How to insert images into hexo blogs
Method(Hexo built in)
source:https://hexo.io/docs/asset-folders
As we all know, the syntax for inserting an image into an md file is ! []()
in .md file, However, there are some difference between markdown and .md runs in Hexo.
There are two necessary steps for using the exist stuffs to enable the image insertation.
Step1: enable post asset folder
In _config.yml
, find and let post_asset_folder: true
.
Then if now you use hexo new 'filename'
, a folder with same name ‘filename’ can be found in source/_posts, you can store the image you want to use in next step.
Step2: insert image into post
{% asset_img 'filename' 'description' %}
You can substitute the filename and description,
i.e.{% asset_img image.jpg this is an image %}