Merge pull request #1213 from tangly1024/fix/hexo-titlle-clamp

line-claimp
This commit is contained in:
tangly1024
2023-06-28 11:36:54 +08:00
committed by GitHub
3 changed files with 2 additions and 12 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -51,7 +51,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
}
>
<div>
<div className='text-line-2'>{post.title}</div>
<div className='line-clamp-2'>{post.title}</div>
<div className="text-gray-500">{post.lastEditedTime}</div>
</div>
</div>