summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-04-24 16:35:26 +0800
committerEltrac <hi@guhub.cn>2025-04-24 16:35:26 +0800
commitd8e62892c512c013ff4af462efac37482467380b (patch)
tree12a8dd2baa2c2b496020c4b6f9e058bd7c41d0ea /layouts
parent7559d8fb54d21d58b64d64877c0ce4eb0ef4abad (diff)
feat: display fictions in index page
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 9b2de377..8ec76d08 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -15,11 +15,15 @@
<time>
{{ .Date.Format "Jan 2" }}
</time>
- <h3{{ if $firstPost }} style="margin-bottom: 0"{{ end }}>
+ <h3 class="posts-item-title"
+ {{ if $firstPost }} style="margin-bottom: 0"{{ end }}>
<a
href="{{ .Permalink }}"
data-umami-event="Click post link from index"
>{{ .Title }}</a>
+ {{ if eq .Section "fictions" }}
+ <span class="posts-item-title-pill">小说</span>
+ {{ end }}
</h3>
</div>
{{ with .Params.categories }}
@@ -38,6 +42,12 @@
</div>
{{ $firstPost = false }} <!-- 更新为非第一篇 -->
{{ end }}
+ <!-- 如果是小说,则显示图标 -->
+ {{ if eq .Section "fictions" }}
+ <div class="posts-item-icon invert-if-dark">
+ <img src="/img/skull-slices.svg" />
+ </div>
+ {{ end }}
</div>
{{ end }}
</div>