gitbook 主题框架

This commit is contained in:
tangly1024
2023-06-23 10:41:43 +08:00
parent 6e76efcde0
commit ee2872d72d
46 changed files with 1688 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ const ThemeGlobalMedium = createContext()
* @constructor
*/
const LayoutBase = props => {
const { children, meta, showInfoCard = true, slotRight, slotTop, siteInfo } = props
const { children, meta, showInfoCard = true, slotLeft, slotTop, siteInfo } = props
const { locale } = useGlobal()
const router = useRouter()
const [tocVisible, changeTocVisible] = useState(false)
@@ -71,7 +71,7 @@ const LayoutBase = props => {
<div className={`hidden xl:block border-l dark:border-transparent w-96 relative z-10 ${CONFIG_MEDIUM.RIGHT_PANEL_DARK ? 'bg-hexo-black-gray dark' : ''}`}>
<div className='py-14 px-6 sticky top-0'>
<Tabs>
{slotRight}
{slotLeft}
<div key={locale.NAV.ABOUT}>
{router.pathname !== '/search' && <SearchInput className='mt-6 mb-12' />}
{showInfoCard && <InfoCard {...props} />}

View File

@@ -28,7 +28,7 @@ export const LayoutSlug = props => {
/>
}
const slotRight = post?.toc && post?.toc?.length > 3 && (
const slotLeft = post?.toc && post?.toc?.length > 3 && (
<div key={locale.COMMON.TABLE_OF_CONTENTS} >
<Catalog toc={post.toc} />
{/* <JumpToTopButton className='text-gray-400 hover:text-green-500 hover:bg-gray-100 py-1 duration-200' /> */}
@@ -36,7 +36,7 @@ export const LayoutSlug = props => {
)
return (
<LayoutBase showInfoCard={true} slotRight={slotRight} {...props} >
<LayoutBase showInfoCard={true} slotLeft={slotLeft} {...props} >
{/* 文章锁 */}
{lock && <ArticleLock validPassword={validPassword} />}