mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
feature:
版面微调
This commit is contained in:
@@ -15,30 +15,19 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
||||
} else {
|
||||
return <div ref={targetRef}>
|
||||
<div className='pt-16 pb-4 text-3xl dark:text-white' id={archiveTitle}>{archiveTitle}</div>
|
||||
<ul className='flex flex-wrap space-y-1'>
|
||||
<ul>
|
||||
{posts.map(post => (
|
||||
<Link key={post.id} href={`${BLOG.path}/article/${post.slug}`} passHref>
|
||||
<li className='w-full border-l pl-2 hover:underline cursor-pointer hover:scale-105 transform duration-500'>
|
||||
<div name={post?.date?.start_date}><span className='text-gray-400'>{post.date.start_date}</span> <span className='dark:text-blue-400 text-blue-600'>{post.title}</span></div>
|
||||
</li>
|
||||
</Link>
|
||||
<li key={post.id} className='border-l-2 p-1 hover:scale-x-105 hover:border-blue-500 transform duration-500'>
|
||||
<div name={post?.date?.start_date}><span className='text-gray-400'>{post.date.start_date}</span>
|
||||
<Link href={`${BLOG.path}/article/${post.slug}`} passHref>
|
||||
<span className='dark:text-blue-400 hover:underline cursor-pointer text-blue-600'>{post.title}</span>
|
||||
</Link>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取从第1页到指定页码的文章
|
||||
* @param page 第几页
|
||||
* @param totalPosts 所有文章
|
||||
* @param postsPerPage 每页文章数量
|
||||
* @returns {*}
|
||||
*/
|
||||
const getPostByPage = function (page, totalPosts, postsPerPage) {
|
||||
return totalPosts.slice(
|
||||
0,
|
||||
postsPerPage * page
|
||||
)
|
||||
}
|
||||
export default BlogPostArchive
|
||||
|
||||
Reference in New Issue
Block a user