在hexo文章中插入图片有两种方式:
- 使用本地路径:将图片上传到本地
- 将图片托管到七牛云: 取图片链接在博客里引入
下面介绍第一种方式
一. 修改配置文件
打开主页配置文件_config.yml
,把post_asset_folder:
设置为:true
|
|
二. 安装图片上传插件
在你的hexo根目录下,右键点击Git Bash Here
,输入npm install hexo-asset-image --save
三. 新建博客
执行hexo new "博客文章名称"
,来生成博文时会在/source/_posts
文件夹内除了博客文章名称.md
文件外还有一个同名的文件夹(这个文件夹就是用来存储你要在博客插入的图片)。
四. 使用
把你的图片放在上一步自动生成的文件夹内,打开你的博客.md
文件,输入:
|
|