hexo设置网站的图标
设置效果:
将你想要设置的图片放到主题目录source文件内,我是在source文件夹内新建了assets文件夹存放头像和网站图标的所有图片,文件路径为\Hexo\themes\yilia-plus\source\assets\img
,并修改主题配置文件_config.yml
:
添加百度统计
简介
百度统计主要用来统计分析网站的访客数据。
需要注册账号,然后将代码嵌入到网站中,hexo d
上传以后等几分钟就可以在百度统计网站上看到数据分析结果了。
百度统计网址:https://tongji.baidu.com
说明
我使用的是yilia-plus主题,已经集成了百度统计,只需要在主题的配置文件中进行配置即可。不同的主题情况不同。
D:\blog\Hexo\themes\yilia-plus\layout\_partial\baidu-analytics.ejs
配置
D:\blog\Hexo\themes\yilia-plus\_config.yml
原内容:
# Miscellaneous
# 百度统计
baidu_analytics: ''
需要在在''
中加入在百度统计页面中生成的代码的id
部分。
百度统计生成的代码:
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?id";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
代码中的id
是一串字符串,
将代码复制到配置文件,D:\blog\Hexo\themes\yilia-plus\layout\_partial\baidu-analytics.ejs
<% if (theme.baidu_analytics){ %>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?id";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<% } %>
如果复制的是我这里的代码块的话,记得将id
部分换成自己生成的字符串。
页脚设置
备案号,busaunzi统计等
在D:\blog\Hexo\themes\yilia-plus\layout\_partialfooter.ejs
中设置
个人博客地址:
www.renjiahong.cn