From 81bc0788f25a204a2f006d227efa6a6c640f7f45 Mon Sep 17 00:00:00 2001 From: yupix Date: Tue, 13 Feb 2024 21:20:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20blogcard=E3=81=A7description=E3=81=8C?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=81=A8?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/scss/custom.scss | 1 + layouts/shortcodes/blogcard.html | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss index 51fe3a1..0481e05 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/custom.scss @@ -20,6 +20,7 @@ .blog-card-content { min-width: 0; /* これ無いと ellipsis が正常に動作しない */ padding: 0.5rem; + height: 100%; & .blog-card-title { color: var(--card-text-color-main); font-size: 1.5rem; diff --git a/layouts/shortcodes/blogcard.html b/layouts/shortcodes/blogcard.html index c63cba7..1c320a2 100644 --- a/layouts/shortcodes/blogcard.html +++ b/layouts/shortcodes/blogcard.html @@ -4,14 +4,20 @@ {{ $parsed_url := urls.Parse $url }} -
-
-
-
{{ $og.title }}
-

- {{ replace ($og.description | plainify) "\n" "" }} -

- {{ $parsed_url.Host }} -
+
+
+
{{ $og.title }}
+ {{- if $og.description -}} +

+ {{ replace ($og.description | plainify) "\n" ""}} +

+ {{- end -}} + + {{ $parsed_url.Host }} + +