Hexo Insert Local Image

Hexo Insert Local Image

1. In the _config.yml of hexo

# post_asset_folder: false
post_asset_folder: true

Set the post_asset_folder option to true.

2. Install plugin

Execute commands in the Hexo directory.

$ npm install hexo-asset-image --save

Download and install a plugin that can upload local images.

install plugin

3. Generate the folder

After the installation is complete, when you run hexo new to generate md blog posts, the /source/_posts folder has a folder with the same name as the md file in addition to the md file.

4. Import the image

Put the image to the folder, then import the image in the markdown format.


Much like a relative path.