tupian
写博客时适当的添加图片是很有效率的一种做法,也会让别人更容易明白你想表达的意思。
如果你的博客也是通过Hexo框架建立的,在使用初期你可能也遇到过和我相似的问题:在一个.md文件中添加的图片并没有在预览中显示出来,下面分享一种解决此问题的方法:
修改博客配置。下载插件。修改博客配置修改博客根目录中_config.yml文件的配置项post_asset_folder为true:
post_asset_folder: true
完成此设置后,当你通过hexo new 文件名新建博客后,会产生一个和文件同名的文件夹。
image.png下载插件在博客根目录中下使用npm安装插件:
npm install https://github.com/CodeFalling/hexo-asset-image –save
示例当文章需要添加图片时,将需要添加的图片放入同名的文件夹中,同时通过相对路径索引到该图片。
例如我在上方修改博客配置中展示的那张图片的md源码为:
*[·-·]:使用命令hexo s开启服务,若无报错在本地可以看到图片在博客中正确显示。
作者:Gsdxiaohei链接:https ...
这是我的第一个Blog尝试
title: postName #文章页面上的显示名称,一般是中文date: 2013-12-02 15:30:16 #文章生成时间,一般不改,当然也可以任意修改categories: 默认分类 #分类tags: [tag1,tag2,tag3] #文章标签,可空,多标签请用格式,注意:后面有个空格description: 附加一段文章摘要,字数最好在140字以内,会出现在meta的description里面
Reward#reward_comment: 坚持原创技术分享,您的支持将鼓励我继续创作!wechatpay: http://p3dm71oa7.bkt.clouddn.com/wcpay.pngalipay: http://p3dm71oa7.bkt.clouddn.com/zfbpay.jpg#bitcoin: /images/bitcoin.png
#
1234567891011=========================== 常用指令收集 ======================================//***挑选了常用指令*** ...
my-first-blog
title: postName #文章页面上的显示名称,一般是中文date: 2013-12-02 15:30:16 #文章生成时间,一般不改,当然也可以任意修改categories: 默认分类 #分类tags: [tag1,tag2,tag3] #文章标签,可空,多标签请用格式,注意:后面有个空格description: 附加一段文章摘要,字数最好在140字以内,会出现在meta的description里面
以下是正文
前言使用github pages服务搭建博客的好处有:
全是静态文件,访问速度快;
免费方便,不用花一分钱就可以搭建一个自由的个人博客,不需要服务器不需要后台;
可以随意绑定自己的域名,不仔细看的话根本看不出来你的网站是基于github的;
数据绝对安全,基于github的版本管理,想恢复到哪个历史版本都行;
博客内容可以轻松打包、转移、发布到其它平台;
等等;