目录显示条件

This commit is contained in:
tangly1024
2022-02-14 09:03:53 +08:00
parent 75d6a04d50
commit ad736e1ef9

View File

@@ -56,7 +56,7 @@ export const LayoutSlug = (props) => {
}
})
const slotRight = post?.toc && <div key={locale.COMMON.TABLE_OF_CONTENTS} className='mt-6'><Catalog toc={post.toc}/></div>
const slotRight = post?.toc && post?.toc?.length > 3 && <div key={locale.COMMON.TABLE_OF_CONTENTS} className='mt-6'><Catalog toc={post.toc}/></div>
return <LayoutBase {...props} meta={meta} showInfoCard={true} slotRight={slotRight}>
<h1 className='text-4xl pt-12 font-sans'>{post?.title}</h1>