From 9ee5969f98fd30823c7292f7e9743f1183779ee6 Mon Sep 17 00:00:00 2001 From: fukunee Date: Thu, 29 Oct 2026 15:13:14 +0800 Subject: [PATCH] Make entire homepage post card clickable --- assets/css/custom.css | 28 ++++++++++++++++++++++++++++ layouts/hextra-home.html | 28 +++++++++------------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/assets/css/custom.css b/assets/css/custom.css index 53035d2..354c52a 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -185,3 +185,31 @@ figcaption.post-caption { padding-left: 2rem; } .footer-roadmap { padding: 1rem 0; } + +/* ===== Homepage post list: entire card is clickable ===== */ +#post-list .home-post-item { + display: block; + color: inherit; + text-decoration: none; + border-radius: 0.5rem; + padding: 0.75rem 1rem; + margin: 0 -1rem 0.5rem; + transition: background-color 0.15s ease; +} + +#post-list .home-post-item h3 { + margin-top: 0; +} + +#post-list .home-post-item:hover { + background-color: rgba(0, 0, 0, 0.04); +} + +html.dark #post-list .home-post-item:hover { + background-color: rgba(255, 255, 255, 0.06); +} + +#post-list .home-post-item:focus-visible { + outline: 2px solid var(--hx-color-primary-500, currentColor); + outline-offset: 2px; +} diff --git a/layouts/hextra-home.html b/layouts/hextra-home.html index 10af189..c21465a 100644 --- a/layouts/hextra-home.html +++ b/layouts/hextra-home.html @@ -15,30 +15,20 @@
{{- range $i, $p := $pages }} -
-

- {{ $p.Title }} -

+

{{ $p.Title }}

{{ partial "utils/format-date" $p.Date }}

- -

- {{- partial "utils/page-description" $p -}} -

-
-
+

+ {{- partial "utils/page-description" $p -}} +

+ {{- end }}