hexo+github打造个人博客系列之小技巧

hexo+github打造个人博客系列之小技巧

这篇博客记录一下hexo+github打造个人博客过程想到的一些小技巧,分享给大家。

去除valine的Powered By

valine评论系统自带Powered By,如下图所示。
valine的Powered By

我喜欢简洁一点,所以想去掉这个提示。查看Elements可以看到这个div,那么我只要移除这个div下的所有子节点,就可以去掉这个Powered By了。修改对应的文件valine.swig,直接上代码:

1
2
3
4
5
6
7
8
9
10
11
new Valine({
...
pageSize:'{{ theme.valine.pageSize }}' || 10,
});
//新增以下代码即可,可以移除.info下所有子节点。
var infoEle = document.querySelector('#comments .info');
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0){
infoEle.childNodes.forEach(function(item) {
item.parentNode.removeChild(item);
});
}

修改后效果:
效果


扫一扫下方小程序码或搜索Tusi博客,即刻阅读最新文章!

Tusi博客

You forgot to set the qrcode for Alipay. Please set it in _config.yml.
You forgot to set the qrcode for Wechat. Please set it in _config.yml.
You forgot to set the business and currency_code for Paypal. Please set it in _config.yml.
You forgot to set the url Patreon. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×