博客图片无法显示的解决办法
博客图片无法显示的解决办法
在博客搭建完成之后,要显示图片,把图片直接引用之后发现无法显示,查了好多文章试了都不起作用。
之前用npm install 一个hexo-asset-image的依赖
1>npm install https://github.com
>npm install https://github.com/CodeFalling/hexo-asset-image --save
这里我们先把他删除
1>npm uninstall https://github.com
>npm uninstall https://github.com/CodeFalling/hexo-asset-image --save
然后
1>npm install hexo-renderer-marked
>npm install hexo-renderer-marked --save
接下来在_config.yaml文件中更改配置,CTRL+F找到post_asset_folder那一行,更改并添加以下内容
之后把需要使用的图片资源放入文章对应名称的文件夹中,在文章中使用 就可以引用图片了
注意写路径时不用包含文件夹名,直接使用图片名称(如:image.jpg)
博客图片无法显示的解决办法
https://z-storm666.github.io/2023/11/16/博客图片无法显示的解决办法/