import BLOG from '@/blog.config' import { getPageTableOfContents } from 'notion-utils' import TocDrawerButton from './components/TocDrawerButton' import LayoutBase from './LayoutBase' import Card from './components/Card' import LatestPostsGroup from './components/LatestPostsGroup' import ArticleDetail from './components/ArticleDetail' import TocDrawer from './components/TocDrawer' import Live2D from './components/Live2D' import { useRef } from 'react' import CONFIG_NEXT from './config_next' export const LayoutSlug = (props) => { const { post, prev, next, recommendPosts, latestPosts, showArticleInfo } = props const meta = { title: `${post.title} | ${BLOG.TITLE}`, description: post.summary, type: 'article', tags: post.tags } const drawerRight = useRef(null) const targetRef = typeof window !== 'undefined' ? document.getElementById('container') : null if (post?.blockMap?.block) { post.content = Object.keys(post.blockMap.block) post.toc = getPageTableOfContents(post, post.blockMap) } const floatSlot = post?.toc?.length > 1 ?
{ drawerRight?.current?.handleSwitchVisible() }} />
: null return ( } > {/* 悬浮目录按钮 */}
{/* 宠物 */}
) }