From a8a6bba283047506b40abaa27e92ec27254c85a9 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 28 Jun 2023 11:34:56 +0800 Subject: [PATCH 1/2] line-claimp --- styles/globals.css | 10 ---------- themes/matery/components/LatestPostsGroup.js | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/styles/globals.css b/styles/globals.css index b791cd3d..042c7f28 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -181,16 +181,6 @@ nav { margin: -0.125em 0.25em; } -/* 固定两行 */ -.text-line-2 { - overflow : hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - word-wrap: break-word; - word-break: break-all; -} .nobelium{ @apply flex flex-col justify-between diff --git a/themes/matery/components/LatestPostsGroup.js b/themes/matery/components/LatestPostsGroup.js index 094b1e40..3cdca279 100644 --- a/themes/matery/components/LatestPostsGroup.js +++ b/themes/matery/components/LatestPostsGroup.js @@ -51,7 +51,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => { } >
-
{post.title}
+
{post.title}
{post.lastEditedTime}
From 8fcc75f99eee373033c79366c7a51d7609039f34 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 28 Jun 2023 11:36:23 +0800 Subject: [PATCH 2/2] formatDate --- lib/formatDate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/formatDate.js b/lib/formatDate.js index 5674b170..6f274da8 100644 --- a/lib/formatDate.js +++ b/lib/formatDate.js @@ -5,7 +5,7 @@ * @returns {string} */ export default function formatDate (date, local) { - if (!date) return '' + if (!date || !local) return date || '' const d = new Date(date) const options = { year: 'numeric', month: 'short', day: 'numeric' } const res = d.toLocaleDateString(local, options)