summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-05-16 16:06:33 +0800
committerEltrac <hi@guhub.cn>2025-05-16 16:06:33 +0800
commitf646564416c2d95a7a6a3d9b1f2e819a716acd0d (patch)
treec6be3cff1563f3141491126f6ec5366d1f73dfdb
parent69e37eac76fd0127b5bc01754f6c0c8548dc097c (diff)
feat: better index page
1. add section link in post list item 2. remove icons indicating section 3. styles Former-commit-id: 0c427dd05a4db9ebd9435b61511f5e3f41b56c53
-rw-r--r--assets/css/components/_postlist.scss6
-rw-r--r--layouts/index.html17
2 files changed, 10 insertions, 13 deletions
diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss
index ece25b80..f66b7b7a 100644
--- a/assets/css/components/_postlist.scss
+++ b/assets/css/components/_postlist.scss
@@ -25,13 +25,15 @@
}
.posts-item-meta {
- time {
+ p, time {
color: var(--secondary-text-color);
+ }
+ time {
font-family: var(--mono-font-family);
}
a.post-tag {
- color: var(--secondary-text-color);
font-size: 0.8rem;
+ color: var(--secondary-text-color);
}
.posts-item-title {
filter: url(#xs);
diff --git a/layouts/index.html b/layouts/index.html
index 6649f9ac..abd5a9f7 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -12,9 +12,12 @@
style="view-transition-name: post-{{ .File.UniqueID }}">
<header>
<div class="posts-item-meta">
- <time>
- {{ .Date.Format "Jan 2" }}
- </time>
+ <p class="font-mono">
+ <time>
+ {{ .Date.Format "Jan 2" }},
+ </time>
+ <span>in <a href="/{{ .Section }}/">{{ .Section }}</a></span>
+ </p>
<h2 class="posts-item-title"
{{ if $firstPost }} style="margin-bottom: 0"{{ end }}>
<a
@@ -48,14 +51,6 @@
</div>
{{ $firstPost = false }} <!-- 更新为非第一篇 -->
{{ end }}
- <!-- 如果是小说,则显示图标 -->
- {{ if or (eq .Section "fictions") (eq .Section "library") }}
- <div class="posts-item-icon invert-if-dark">
- <img src="{{ if eq .Section "fictions" }}
- {{ .Site.BaseURL }}img/skull-slices.svg{{ else }}
- {{ .Site.BaseURL }}img/book-storm.svg{{ end }}" />
- </div>
- {{ end }}
</div>
{{ end }}
</div>