example主题添加目录

This commit is contained in:
tangly1024.com
2024-06-27 09:57:48 +08:00
parent fbf215df37
commit 3727064af1
2 changed files with 105 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import dynamic from 'next/dynamic'
import Link from 'next/link'
import CONFIG from '../config'
import Announcement from './Announcement'
import Catalog from './Catalog'
const ExampleRecentComments = dynamic(
() => import('./RecentCommentListForExample')
)
@@ -32,6 +33,16 @@ export const SideBar = props => {
return (
<>
{/* 目录 */}
{post?.toc && post?.toc.length > 2 && (
<aside className='w-full rounded shadow overflow-hidden mb-6 pb-4'>
<h3 className='text-sm bg-gray-100 text-gray-700 dark:bg-hexo-black-gray dark:text-gray-200 py-3 px-4 dark:border-hexo-black-gray border-b'>
{locale.COMMON.TABLE_OF_CONTENTS}
</h3>
<Catalog toc={post?.toc} />
</aside>
)}
{/* 分类 */}
<aside className='w-full rounded shadow overflow-hidden mb-6'>
<h3 className='text-sm bg-gray-100 text-gray-700 dark:bg-hexo-black-gray dark:text-gray-200 py-3 px-4 dark:border-hexo-black-gray border-b'>