mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
Hexo:lates组件字体
This commit is contained in:
@@ -18,9 +18,13 @@ const LatestPostsGroup = ({ posts }) => {
|
||||
const currentPath = useRouter().asPath
|
||||
const { locale } = useGlobal()
|
||||
|
||||
return <>
|
||||
<div className='font-sans mb-2 px-1 flex flex-nowrap justify-between'>
|
||||
<div><i className='mr-2 fas fas fa-history' />{locale.COMMON.LATEST_POSTS}</div>
|
||||
return (
|
||||
<>
|
||||
<div className="font-sans mb-2 px-1 flex flex-nowrap justify-between">
|
||||
<div>
|
||||
<i className="mr-2 fas fas fa-history" />
|
||||
{locale.COMMON.LATEST_POSTS}
|
||||
</div>
|
||||
</div>
|
||||
{posts.map(post => {
|
||||
const selected = currentPath === `${BLOG.PATH}/article/${post.slug}`
|
||||
@@ -29,20 +33,34 @@ const LatestPostsGroup = ({ posts }) => {
|
||||
: `url("/${CONFIG_HEXO.HOME_BANNER_IMAGE}")`
|
||||
|
||||
return (
|
||||
<Link key={post.id} title={post.title} href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
||||
<a className={ 'my-1 flex '}>
|
||||
<div className='w-20 h-16 bg-cover bg-center bg-no-repeat' style={{ backgroundImage: headerImage }}/>
|
||||
<div className={ (selected ? ' text-blue-400 ' : 'dark:text-gray-400 ') + ' text-sm py-1.5 overflow-x-hidden hover:text-blue-400 px-2 duration-200 w-full rounded ' +
|
||||
'hover:text-white dark:hover:text-white cursor-pointer items-center flex'}>
|
||||
<div>
|
||||
<div style={{ WebkitLineClamp: 2 }}>{post.title}</div>
|
||||
<div className='text-gray-500'>{post.date?.start_date}</div>
|
||||
</div>
|
||||
<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${BLOG.PATH}/article/${post.slug}`}
|
||||
passHref
|
||||
>
|
||||
<a className={'my-1 flex font-sans'}>
|
||||
<div
|
||||
className="w-20 h-16 bg-cover bg-center bg-no-repeat"
|
||||
style={{ backgroundImage: headerImage }}
|
||||
/>
|
||||
<div
|
||||
className={
|
||||
(selected ? ' text-blue-400 ' : 'dark:text-gray-400 ') +
|
||||
' text-sm py-1.5 overflow-x-hidden hover:text-blue-400 px-2 duration-200 w-full rounded ' +
|
||||
'hover:text-white dark:hover:text-white cursor-pointer items-center flex'
|
||||
}
|
||||
>
|
||||
<div>
|
||||
<div style={{ WebkitLineClamp: 2 }}>{post.title}</div>
|
||||
<div className="text-gray-500">{post.date?.start_date}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default LatestPostsGroup
|
||||
|
||||
Reference in New Issue
Block a user