编写
将heimu.css
文件放在themes/archie/assets/css/
文件夹中
/* heimu.css */
.heimu, .heimu a, a .heimu, .heimu a.new {
background-color: #252525;
color: #252525;
text-shadow: none;
}
.heimu:hover, .heimu:active,
.heimu:hover .heimu, .heimu:active .heimu {
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;
}
编写heimu.html
放在layouts/shortcodes/
文件夹中
<!-- layouts/shortcodes/heimu.html -->
<span class="heimu" title="{{ .Get "title" }}">{{ .Get "text" }}</span>
在layouts/partials/head.html中添加
<link rel="stylesheet" href="/css/heimu.css">
使用
{{< heimu title="完全没理解" text="太棒了,我逐渐理解一切" >}}
太棒了,我逐渐理解一切