2022-07-29  2024-09-18    260 字  1 分钟

编写

heimu.css文件放在themes/archie/assets/css/文件夹中

 1/* heimu.css */
 2
 3.heimu, .heimu a, a .heimu, .heimu a.new {
 4    background-color: #252525;
 5    color: #252525;
 6    text-shadow: none;
 7}
 8
 9.heimu:hover, .heimu:active,
10.heimu:hover .heimu, .heimu:active .heimu {
11    color: white !important;
12}
13
14.heimu:hover a, a:hover .heimu,
15.heimu:active a, a:active .heimu {
16    color: lightblue !important;
17}
18
19.heimu:hover .new, .heimu .new:hover, .new:hover .heimu,
20.heimu:active .new, .heimu .new:active, .new:active .heimu {
21    color: #BA0000 !important;
22}

编写heimu.html放在layouts/shortcodes/文件夹中

1<!-- layouts/shortcodes/heimu.html -->
2<span class="heimu" title="{{ .Get "title" }}">{{ .Get "text" }}</span>

在layouts/partials/head.html中添加

1    <link rel="stylesheet" href="/css/heimu.css">

使用

1{{< heimu title="完全没理解" text="太棒了,我逐渐理解一切" >}}
太棒了,我逐渐理解一切

除另有声明外本博客文章均采用 知识共享 (Creative Commons) 署名 4.0 国际许可协议 进行许可转载请注明原作者与文章出处