前言
众所周知,我在随机任务:指导者的牢里寂寞地缝着天阳马,于是便开始思索如何在博客周记里美观地分享导随记录,最后锁定了简单神奇的 hugo 短代码功能,在 ChatGPT 的协助下,花了两三个摸鱼时间研究,大致做出了自己想要的效果。
非常感谢鹤辞博客里记录的 Hugo 短代码存档,易读好用的完美抄作业模板,我的小玩具引入百科全书!这个日随卡片就是基于里面的仿 github 样式修改而成的。卡片的样式则参考了导随统计器。
一言以蔽之,这个日随卡片的优点:美丽。缺点:废物。因为我根本,完全不会写导入 ff14 副本模板的数据库,所以一切数据都需要机械地手动输入,如果要记录您所有的副本,还是建议使用导随统计器或者 excel 表格。
使用方法
引入
-
下载这里的 icon 文件,解压后整个文件夹放在
/static
目录下。 -
在
/layouts/shortcodes
内新建一个ff14.html
复制以下内容:
<div class="ff14 {{ .Get "class" }}">
<div class="logo-container">
<div class="logo">
<img src="{{ .Get "logo" }}" alt="Logo">
</div>
</div>
<div class="info">
{{ if .Get "level" }}
<span class="level-name">
<span class="level">LV.{{ .Get "level" }}</span>
<span class="name">{{ .Get "name" }}</span>
</span>
{{ else }}
<span class="name">{{ .Get "name" }}</span>
{{ end }}
<div class="description"> {{ .Get "description" }}</div>
<div class="tag">
<span class="tag-color"></span>
<span class="tag-name">{{ .Get "tag" }}</span>
</div>
</div>
<div class="time">{{ .Get "time" }}</div>
</div>
- 在自定义 css 里丢入
css
代码。
注意:文字颜色设置的具体变量会因主题不同而改变。
.ff14 {
border: 1px solid var(--color-text-primary);
border-radius: 20px;
margin: 0 auto;
margin-bottom: 1em;
padding: 0.5em;
display: flex;
align-items: center; /* 垂直居中 */
position: relative;
&.t {
background-color: rgba(0, 47, 167, 0.3);
.tag-color {
background-color: #5e86c1;
}
}
&.n {
background-color: rgba(34, 139, 34, 0.3);
.tag-color {
background-color: #8fbc8f;
}
}
&.d {
background-color: rgba(128, 0, 0, 0.3);
.tag-color {
background-color: #cd5c5c;
}
}
&.s{
background-color: rgba(189, 183, 107, 0.3);
.tag-color {
background-color: #e6c35c;
}
}
.logo-container {
width: 5.5rem; /* 设置图片容器的宽度 */
float: left; /* 左浮动,使文字不会覆盖图片 */
margin-right: 1.5em; /* 可选的右边距 */
}
.logo {
width: 5.5rem;
height: 5.5rem;
display: flex;
align-items: center; /* 垂直居中 */
justify-content: flex-start; /* 左对齐 */
margin-right:10px;
}
.info {
display: flex;
flex-direction: column;
position: relative;
}
.level {
color: var(-color-text-primary); /* 数字模块的文本颜色 */
font-weight: bold;
font-size: 28px;
margin-right: 10px;
}
.name {
font-weight: bold;
font-size: 28px;
color: var(-color-text-primary);
}
.description {
margin-top: 0.5em;
margin-bottom: 0.5em;
color: var(-color-text-primary);
text-align: justify;
font-size: 95%;
margin-right: 0.5em;
}
.tag-color {
position: relative;
top: 1px;
display: inline-block;
width: 0.75em;
height: 0.75em;
border-radius: 50%;
}
.tag-name {
color: var(-color-text-primary);
font-size: 90%;
margin-left: 0.5em;
}
.time {
position: absolute;
bottom: 0.5em;
right: 0.5em;
padding: 5px;
color: var(-color-text-primary);
font-size: 16px;
text-align: right; /* 将文本右对齐 */
}
}
@media screen and (max-width: 768px) {
.ff14 {
padding: 0.4em;
.logo-container {
width: 5rem; /* 设置图片容器的宽度 */
float: left; /* 左浮动,使文字不会覆盖图片 */
margin-right: 0.5em; /* 可选的右边距 */
}
.logo {
width: 5rem;
height: 5rem;
display: flex;
align-items: center; /* 垂直居中 */
justify-content: flex-start; /* 左对齐 */
margin-right:5px;
}
.level {
font-size: 22px;
margin-right: 5px;
}
.name {
font-size: 22px;
}
.description {
font-size: 75%;
}
.tag-name {
font-size: 70%;
margin-left: 0.3em;
}
.time {
display: none;
}
}
}
短代码
实际使用时要在外面再加一层大括号。
{< ff14
class=""
logo=""
level=""
name=""
description=""
tag=""
time="">}
class:可选t
、n
、d
、s
(生产采集),改变卡片的背景颜色。
logo:你的职业图标文件路径,例如/icon/paladin.png
。
level(可选):副本等级。
name:副本名。
description:感想。
tag:副本类型,也可以填你喜欢的标注。
time(可选):时间,会显示在右下角。

全职业示例
防护职业






治疗职业





近战职业








远程物理职业




远程魔法职业





生产采集职业


Freetalk
做完啦!虽然感觉没人会用但是使用随意!如果有朋友用了并且成功了,请务必和我说一声我超级想看。如果有神仙老师魔改了,也希望能告诉我,因为我也想用!!!!(草
Preview: