mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 07:26:47 +00:00
HEO 首页支持配置单列显示博客
This commit is contained in:
@@ -19,7 +19,7 @@ const BlogPostListScroll = ({
|
||||
showSummary = siteConfig('HEO_POST_LIST_SUMMARY', null, CONFIG),
|
||||
siteInfo
|
||||
}) => {
|
||||
const { NOTION_CONFIG } = useGlobal()
|
||||
const { locale, NOTION_CONFIG } = useGlobal()
|
||||
const [page, updatePage] = useState(1)
|
||||
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
|
||||
const postsToShow = getListByPage(posts, page, POSTS_PER_PAGE)
|
||||
@@ -59,15 +59,20 @@ const BlogPostListScroll = ({
|
||||
})
|
||||
|
||||
const targetRef = useRef(null)
|
||||
const { locale } = useGlobal()
|
||||
|
||||
const POST_TWO_COLS = siteConfig(
|
||||
'HEO_HOME_POST_TWO_COLS',
|
||||
null,
|
||||
NOTION_CONFIG
|
||||
)
|
||||
if (!postsToShow || postsToShow.length === 0) {
|
||||
return <BlogPostListEmpty currentSearch={currentSearch} />
|
||||
} else {
|
||||
return (
|
||||
<div id='container' ref={targetRef} className='w-full'>
|
||||
{/* 文章列表 */}
|
||||
<div className='2xl:grid 2xl:grid-cols-2 grid-cols-1 gap-5'>
|
||||
<div
|
||||
className={`2xl:grid ${POST_TWO_COLS && '2xl:grid-cols-2'} grid-cols-1 gap-5`}>
|
||||
{' '}
|
||||
{postsToShow.map(post => (
|
||||
<BlogPostCard
|
||||
key={post.id}
|
||||
|
||||
Reference in New Issue
Block a user