Make blog list cards fully clickable

This commit is contained in:
2026-11-15 09:18:36 +08:00
parent 8b13c76513
commit 88c8c36d02
4 changed files with 33 additions and 28 deletions
+12 -20
View File
@@ -21,34 +21,26 @@
<div id="post-list">
{{- range $i, $p := $pages }}
{{- /* 整块卡片即一个链接:框内任意位置点击都进入文章;
标签放在卡片外面,保证标签本身仍是可点链接 */}}
<div
class="hx:mb-10 blog-post-item{{ if ge $i $batch }} hx:hidden{{ end }}"
class="blog-post-item{{ if ge $i $batch }} hx:hidden{{ end }}"
data-index="{{ $i }}"
>
<h3>
<a
style="color: inherit; text-decoration: none"
class="hx:block hx:font-semibold hx:mt-8 hx:text-2xl"
href="{{ $p.RelPermalink }}"
>{{ $p.Title }}</a
>
</h3>
<p class="hx:opacity-50 hx:text-sm hx:mt-1 hx:leading-7">
{{ partial "utils/format-date" $p.Date }}
</p>
<a href="{{ $p.RelPermalink }}" class="post-card">
<h3 class="hx:text-2xl">{{ $p.Title }}</h3>
<p class="hx:opacity-50 hx:text-sm hx:mt-1 hx:leading-7">
{{ partial "utils/format-date" $p.Date }}
</p>
<p class="hx:opacity-80 hx:mt-2 hx:leading-7">
{{- partial "utils/page-description" $p -}}
</p>
</a>
{{ if site.Params.blog.list.displayTags }}
<div class="hx:text-sm hx:leading-7">
{{ partial "tags.html" (dict "context" $p) }}
</div>
{{ end }}
<a
href="{{ $p.RelPermalink }}"
style="color: inherit; text-decoration: none"
>
<p class="hx:opacity-80 hx:mt-2 hx:leading-7">
{{- partial "utils/page-description" $p -}}
</p>
</a>
</div>
{{- end }}
</div>
+1 -1
View File
@@ -18,7 +18,7 @@
{{- /* 整块卡片即一个链接:框内任意位置点击都进入文章 */}}
<a
href="{{ $p.RelPermalink }}"
class="home-post-item{{ if ge $i $batch }} hx:hidden{{ end }}"
class="home-post-item post-card{{ if ge $i $batch }} hx:hidden{{ end }}"
data-index="{{ $i }}"
>
<h3 class="hx:text-xl">{{ $p.Title }}</h3>