目录

前言

在逛萌娘百科的时候, 感觉黑幕很有意思, 可以把一些不太正经的话(bushi)像这样遮盖起来
我试图在网上找到一些hexo实现方法但最终都没有用, 这里分享下我的实现方法

修改主题的styl&js

styl

首先修改主题的 themes\butterfly\source\css_global\index.styl
在代码最下方加入

1
2
3
4
5
6
7
8
9
10
11
12
13
.heimu, .heimu a, a .heimu, .heimu a.new, .heimu code
background-color: #252525 !important
color: #252525 !important
text-shadow: none
.heimu:hover, .heimu:active,
.heimu:hover .heimu, .heimu:active .heimu,.heimu code:hover
color: white !important;
.heimu:hover a, a:hover .heimu,
.heimu:active a, a:active .heimu
color: lightblue !important;
.heimu:hover .new, .heimu .new:hover, .new:hover .heimu,
.heimu:active .new, .heimu .new:active, .new:active .heimu
color: #BA0000 !important;

注意:styl对缩进要求严格

js

然后打开themes\butterfly\source\js\main.js
在最后加上

1
2
3
4
const addheimuTitle = function(){
console.log(123)
$('.heimu').attr('title','你知道的太多了')
}

最后进行下hexo三连
1
2
3
hexo cl
hexo g
hexo s

如何在文章中使用黑幕

只需要在heimu标签里加上想要隐藏的东西

1
<span class='heimu'>隐藏的文字</span>

结尾

这是这个博客第一篇文章
以后会更新一些关于 对游戏番剧评论 教程 闲聊 类的文章