Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files Browse the repository at this point in the history
actions-user committed Jun 6, 2024
2 parents c5825ff + 38af4ff commit 9e59bd1
Showing 15 changed files with 311 additions and 77 deletions.
3 changes: 3 additions & 0 deletions blog.config.js
Original file line number Diff line number Diff line change
@@ -39,6 +39,9 @@ const BLOG = {
CONTACT_INSTAGRAM: process.env.NEXT_PUBLIC_CONTACT_INSTAGRAM || '', // 您的instagram地址
CONTACT_BILIBILI: process.env.NEXT_PUBLIC_CONTACT_BILIBILI || 'https://b23.tv/6ZtRxaf', // B站主页
CONTACT_YOUTUBE: process.env.NEXT_PUBLIC_CONTACT_YOUTUBE || '', // Youtube主页
CONTACT_XIAOHONGSHU: process.env.NEXT_PUBLIC_CONTACT_XIAOHONGSHU || '', // 小红书主页
CONTACT_ZHISHIXINGQIU: process.env.NEXT_PUBLIC_CONTACT_ZHISHIXINGQIU || '', // 知识星球
CONTACT_WEHCHAT_PUBLIC: process.env.NEXT_PUBLIC_CONTACT_WEHCHAT_PUBLIC || '', // 微信公众号 格式:https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=【xxxxxx】==#wechat_redirect

NOTION_HOST: process.env.NEXT_PUBLIC_NOTION_HOST || 'https://www.notion.so', // Notion域名,您可以选择用自己的域名进行反向代理,如果不懂得什么是反向代理,请勿修改此项

5 changes: 4 additions & 1 deletion lib/global.js
Original file line number Diff line number Diff line change
@@ -79,7 +79,10 @@ export function GlobalContextProvider(props) {
useEffect(() => {
initDarkMode(updateDarkMode, defaultDarkMode)
initLocale(lang, locale, updateLang, updateLocale)
redirectUserLang(NOTION_PAGE_ID)
// 可以
if (NOTION_CONFIG?.REDIRECT_LANG) {
redirectUserLang(NOTION_PAGE_ID)
}
}, [])

// 加载进度条
1 change: 1 addition & 0 deletions public/svg/xiaohongshu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/svg/zhishixingqiu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion themes/heo/components/Header.js
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ const Header = props => {
{/* 顶部导航菜单栏 */}
<nav
id='nav'
className={`z-20 h-16 top-0 w-full
className={`z-20 h-16 top-0 w-full duration-500 transition-all
${fixedNav ? 'fixed' : 'relative bg-transparent'}
${textWhite ? 'text-white ' : 'text-black dark:text-white'}
${navBgWhite ? 'bg-white dark:bg-[#18171d] shadow' : 'bg-transparent'}`}>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import { saveDarkModeToLocalStorage } from '@/themes/theme'
import CONFIG from '../config'
import { siteConfig } from '@/lib/config'

export default function FloatDarkModeButton () {
/**
* 深色模式按钮
*/
export default function ButtonDarkModeFloat() {
const { isDarkMode, updateDarkMode } = useGlobal()

if (!siteConfig('HEXO_WIDGET_DARK_MODE', null, CONFIG)) {
@@ -23,10 +26,13 @@ export default function FloatDarkModeButton () {
return (
<div
onClick={handleChangeDarkMode}
className={'justify-center items-center w-7 h-7 text-center transform hover:scale-105 duration-200'
}
>
<i id="darkModeButton" className={`${isDarkMode ? 'fa-sun' : 'fa-moon'} fas text-xs`}/>
className={
'justify-center items-center w-7 h-7 text-center transform hover:scale-105 duration-200'
}>
<i
id='darkModeButton'
className={`${isDarkMode ? 'fa-sun' : 'fa-moon'} fas text-xs`}
/>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
import CONFIG from '../config'
import { siteConfig } from '@/lib/config'
import CONFIG from '../config'

/**
* 跳转到评论区
* @returns {JSX.Element}
* @constructor
*/
const JumpToCommentButton = () => {
const ButtonJumpToComment = () => {
if (!siteConfig('HEXO_WIDGET_TO_COMMENT', null, CONFIG)) {
return <></>
}

function navToComment() {
if (document.getElementById('comment')) {
window.scrollTo({ top: document.getElementById('comment').offsetTop, behavior: 'smooth' })
window.scrollTo({
top: document.getElementById('comment').offsetTop,
behavior: 'smooth'
})
}
// 兼容性不好
// const commentElement = document.getElementById('comment')
// if (commentElement) {
// commentElement?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })
}

return (<div className='flex space-x-1 items-center justify-center transform hover:scale-105 duration-200 w-7 h-7 text-center' onClick={navToComment} >
<i className='fas fa-comment text-xs' />
</div>)
return (
<div
className='flex space-x-1 items-center justify-center transform hover:scale-105 duration-200 w-7 h-7 text-center'
onClick={navToComment}>
<i className='fas fa-comment text-xs' />
</div>
)
}

export default JumpToCommentButton
export default ButtonJumpToComment
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
import { siteConfig } from '@/lib/config'

/**
* 跳转到网页顶部
@@ -10,7 +10,7 @@ import { siteConfig } from '@/lib/config'
* @returns {JSX.Element}
* @constructor
*/
const JumpToTopButton = ({ showPercent = true, percent }) => {
const ButtonJumpToTop = ({ showPercent = true, percent }) => {
const { locale } = useGlobal()

if (!siteConfig('HEXO_WIDGET_TO_TOP', null, CONFIG)) {
@@ -22,4 +22,4 @@ const JumpToTopButton = ({ showPercent = true, percent }) => {
</div>)
}

export default JumpToTopButton
export default ButtonJumpToTop
29 changes: 29 additions & 0 deletions themes/hexo/components/ButtonRandomPost.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'

/**
* 随机跳转到一个文章
*/
export default function ButtonRandomPost(props) {
const { latestPosts } = props
const router = useRouter()
const { locale } = useGlobal()
/**
* 随机跳转文章
*/
function handleClick() {
const randomIndex = Math.floor(Math.random() * latestPosts.length)
const randomPost = latestPosts[randomIndex]
router.push(`${siteConfig('SUB_PATH', '')}/${randomPost?.slug}`)
}

return (
<div
title={locale.MENU.WALK_AROUND}
className='cursor-pointer hover:bg-black hover:bg-opacity-10 rounded-full w-10 h-10 flex justify-center items-center duration-200 transition-all'
onClick={handleClick}>
<i className='fa-solid fa-podcast'></i>
</div>
)
}
29 changes: 29 additions & 0 deletions themes/hexo/components/ButtonRandomPostMini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'

/**
* 随机跳转到一个文章
*/
export default function ButtonRandomPostMini(props) {
const { latestPosts } = props
const router = useRouter()
const { locale } = useGlobal()
/**
* 随机跳转文章
*/
function handleClick() {
const randomIndex = Math.floor(Math.random() * latestPosts.length)
const randomPost = latestPosts[randomIndex]
router.push(`${siteConfig('SUB_PATH', '')}/${randomPost?.slug}`)
}

return (
<div
title={locale.MENU.WALK_AROUND}
className='flex space-x-1 items-center justify-center transform hover:scale-105 duration-200 w-7 h-7 text-center'
onClick={handleClick}>
<i className='fa-solid fa-podcast'></i>
</div>
)
}
3 changes: 3 additions & 0 deletions themes/hexo/components/Header.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import Link from 'next/link'
import { useRouter } from 'next/router'
import { useCallback, useEffect, useRef, useState } from 'react'
import CONFIG from '../config'
import ButtonRandomPost from './ButtonRandomPost'
import CategoryGroup from './CategoryGroup'
import Logo from './Logo'
import { MenuListTop } from './MenuListTop'
@@ -28,6 +29,7 @@ const Header = props => {
const router = useRouter()
const [isOpen, changeShow] = useState(false)
const showSearchButton = siteConfig('HEXO_MENU_SEARCH', false, CONFIG)
const showRandomButton = siteConfig('HEXO_MENU_RANDOM', false, CONFIG)

const toggleMenuOpen = () => {
changeShow(!isOpen)
@@ -172,6 +174,7 @@ const Header = props => {
)}
</div>
{showSearchButton && <SearchButton />}
{showRandomButton && <ButtonRandomPost {...props} />}
</div>
</div>
</div>
51 changes: 29 additions & 22 deletions themes/hexo/components/RightFloatArea.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import throttle from 'lodash.throttle'
import { useCallback, useEffect, useState } from 'react'
import FloatDarkModeButton from './FloatDarkModeButton'
import JumpToTopButton from './JumpToTopButton'
import ButtonDarkModeFloat from './ButtonFloatDarkMode'
import ButtonJumpToTop from './ButtonJumpToTop'

/**
* 悬浮在右下角的按钮,当页面向下滚动100px时会出现
@@ -10,33 +10,40 @@ import JumpToTopButton from './JumpToTopButton'
*/
export default function RightFloatArea({ floatSlot }) {
const [showFloatButton, switchShow] = useState(false)
const scrollListener = useCallback(throttle(() => {
const targetRef = document.getElementById('wrapper')
const clientHeight = targetRef?.clientHeight
const scrollY = window.pageYOffset
const fullHeight = clientHeight - window.outerHeight
let per = parseFloat(((scrollY / fullHeight) * 100).toFixed(0))
if (per > 100) per = 100
const shouldShow = scrollY > 100 && per > 0
const scrollListener = useCallback(
throttle(() => {
const targetRef = document.getElementById('wrapper')
const clientHeight = targetRef?.clientHeight
const scrollY = window.pageYOffset
const fullHeight = clientHeight - window.outerHeight
let per = parseFloat(((scrollY / fullHeight) * 100).toFixed(0))
if (per > 100) per = 100
const shouldShow = scrollY > 100 && per > 0

// 右下角显示悬浮按钮
if (shouldShow !== showFloatButton) {
switchShow(shouldShow)
}
}, 200))
// 右下角显示悬浮按钮
if (shouldShow !== showFloatButton) {
switchShow(shouldShow)
}
}, 200)
)

useEffect(() => {
document.addEventListener('scroll', scrollListener)
return () => document.removeEventListener('scroll', scrollListener)
}, [])

return (
<div className={(showFloatButton ? 'opacity-100 ' : 'invisible opacity-0') + ' duration-300 transition-all bottom-12 right-1 fixed justify-end z-20 text-white bg-indigo-500 dark:bg-hexo-black-gray rounded-sm'}>
<div className={'justify-center flex flex-col items-center cursor-pointer'}>
<FloatDarkModeButton />
{floatSlot}
<JumpToTopButton />
</div>
</div>
<div
className={
(showFloatButton ? 'opacity-100 ' : 'invisible opacity-0') +
' duration-300 transition-all bottom-12 right-1 fixed justify-end z-20 text-white bg-indigo-500 dark:bg-hexo-black-gray rounded-sm'
}>
<div
className={'justify-center flex flex-col items-center cursor-pointer'}>
<ButtonDarkModeFloat />
{floatSlot}
<ButtonJumpToTop />
</div>
</div>
)
}
201 changes: 168 additions & 33 deletions themes/hexo/components/SocialButton.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,179 @@
import QrCode from '@/components/QrCode'
import { siteConfig } from '@/lib/config'
import { useState } from 'react'

/**
* 社交联系方式按钮组
* @returns {JSX.Element}
* @constructor
*/
const SocialButton = () => {
return <div className='w-full justify-center flex-wrap flex'>
<div className='space-x-3 text-xl text-gray-600 dark:text-gray-300 '>
{siteConfig('CONTACT_GITHUB') && <a target='_blank' rel='noreferrer' title={'github'} href={siteConfig('CONTACT_GITHUB')} >
<i className='transform hover:scale-125 duration-150 fab fa-github dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_TWITTER') && <a target='_blank' rel='noreferrer' title={'twitter'} href={siteConfig('CONTACT_TWITTER')} >
<i className='transform hover:scale-125 duration-150 fab fa-twitter dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_TELEGRAM') && <a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_TELEGRAM')} title={'telegram'} >
<i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_LINKEDIN') && <a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_LINKEDIN')} title={'linkIn'} >
<i className='transform hover:scale-125 duration-150 fab fa-linkedin dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_WEIBO') && <a target='_blank' rel='noreferrer' title={'weibo'} href={siteConfig('CONTACT_WEIBO')} >
<i className='transform hover:scale-125 duration-150 fab fa-weibo dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_INSTAGRAM') && <a target='_blank' rel='noreferrer' title={'instagram'} href={siteConfig('CONTACT_INSTAGRAM')} >
<i className='transform hover:scale-125 duration-150 fab fa-instagram dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_EMAIL') && <a target='_blank' rel='noreferrer' title={'email'} href={`mailto:${siteConfig('CONTACT_EMAIL')}`} >
<i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{JSON.parse(siteConfig('ENABLE_RSS')) && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='transform hover:scale-125 duration-150 fas fa-rss dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_BILIBILI') && <a target='_blank' rel='noreferrer' title={'bilibili'} href={siteConfig('CONTACT_BILIBILI')} >
<i className='transform hover:scale-125 duration-150 fab fa-bilibili dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{siteConfig('CONTACT_YOUTUBE') && <a target='_blank' rel='noreferrer' title={'youtube'} href={siteConfig('CONTACT_YOUTUBE')} >
<i className='transform hover:scale-125 duration-150 fab fa-youtube dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
const CONTACT_GITHUB = siteConfig('CONTACT_GITHUB')
const CONTACT_TWITTER = siteConfig('CONTACT_TWITTER')
const CONTACT_TELEGRAM = siteConfig('CONTACT_TELEGRAM')

const CONTACT_LINKEDIN = siteConfig('CONTACT_LINKEDIN')
const CONTACT_WEIBO = siteConfig('CONTACT_WEIBO')
const CONTACT_INSTAGRAM = siteConfig('CONTACT_INSTAGRAM')
const CONTACT_EMAIL = siteConfig('CONTACT_EMAIL')
const ENABLE_RSS = siteConfig('ENABLE_RSS')
const CONTACT_BILIBILI = siteConfig('CONTACT_BILIBILI')
const CONTACT_YOUTUBE = siteConfig('CONTACT_YOUTUBE')

const CONTACT_XIAOHONGSHU = siteConfig('CONTACT_XIAOHONGSHU')
const CONTACT_ZHISHIXINGQIU = siteConfig('CONTACT_ZHISHIXINGQIU')
const CONTACT_WEHCHAT_PUBLIC = siteConfig('CONTACT_WEHCHAT_PUBLIC')

const [qrCodeShow, setQrCodeShow] = useState(false)

const openPopover = () => {
setQrCodeShow(true)
}
const closePopover = () => {
setQrCodeShow(false)
}
return (
<div className='w-full justify-center flex-wrap flex'>
<div className='space-x-3 text-xl flex items-center text-gray-600 dark:text-gray-300 '>
{CONTACT_GITHUB && (
<a
target='_blank'
rel='noreferrer'
title={'github'}
href={CONTACT_GITHUB}>
<i className='transform hover:scale-125 duration-150 fab fa-github dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_TWITTER && (
<a
target='_blank'
rel='noreferrer'
title={'twitter'}
href={CONTACT_TWITTER}>
<i className='transform hover:scale-125 duration-150 fab fa-twitter dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_TELEGRAM && (
<a
target='_blank'
rel='noreferrer'
href={CONTACT_TELEGRAM}
title={'telegram'}>
<i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_LINKEDIN && (
<a
target='_blank'
rel='noreferrer'
href={CONTACT_LINKEDIN}
title={'linkIn'}>
<i className='transform hover:scale-125 duration-150 fab fa-linkedin dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_WEIBO && (
<a
target='_blank'
rel='noreferrer'
title={'weibo'}
href={CONTACT_WEIBO}>
<i className='transform hover:scale-125 duration-150 fab fa-weibo dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_INSTAGRAM && (
<a
target='_blank'
rel='noreferrer'
title={'instagram'}
href={CONTACT_INSTAGRAM}>
<i className='transform hover:scale-125 duration-150 fab fa-instagram dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_EMAIL && (
<a
target='_blank'
rel='noreferrer'
title={'email'}
href={`mailto:${CONTACT_EMAIL}`}>
<i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{ENABLE_RSS && (
<a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'}>
<i className='transform hover:scale-125 duration-150 fas fa-rss dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_BILIBILI && (
<a
target='_blank'
rel='noreferrer'
title={'bilibili'}
href={CONTACT_BILIBILI}>
<i className='transform hover:scale-125 duration-150 dark:hover:text-indigo-400 hover:text-indigo-600 fab fa-bilibili' />
</a>
)}
{CONTACT_YOUTUBE && (
<a
target='_blank'
rel='noreferrer'
title={'youtube'}
href={CONTACT_YOUTUBE}>
<i className='transform hover:scale-125 duration-150 fab fa-youtube dark:hover:text-indigo-400 hover:text-indigo-600' />
</a>
)}
{CONTACT_XIAOHONGSHU && (
<a
target='_blank'
rel='noreferrer'
title={'小红书'}
href={CONTACT_XIAOHONGSHU}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
className='transform hover:scale-125 duration-150 w-6'
src='/svg/xiaohongshu.svg'
alt='小红书'
/>
</a>
)}
{CONTACT_ZHISHIXINGQIU && (
<a
target='_blank'
rel='noreferrer'
title={'知识星球'}
href={CONTACT_ZHISHIXINGQIU}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
className='transform hover:scale-125 duration-150 w-6'
src='/svg/zhishixingqiu.svg'
alt='知识星球'
/>{' '}
</a>
)}
{CONTACT_WEHCHAT_PUBLIC && (
<button
onMouseEnter={openPopover}
onMouseLeave={closePopover}
aria-label={'微信公众号'}>
<div id='wechat-button'>
<i className='transform scale-105 hover:scale-125 duration-150 fab fa-weixin dark:hover:text-indigo-400 hover:text-indigo-600' />
</div>
{/* 二维码弹框 */}
<div className='absolute'>
<div
id='pop'
className={
(qrCodeShow ? 'opacity-100 ' : ' invisible opacity-0') +
' z-40 absolute bottom-10 -left-10 bg-white shadow-xl transition-all duration-200 text-center'
}>
<div className='p-2 mt-1 w-28 h-28'>
{qrCodeShow && <QrCode value={CONTACT_WEHCHAT_PUBLIC} />}
</div>
</div>
</div>
</button>
)}
</div>
</div>
</div>
)
}
export default SocialButton
8 changes: 7 additions & 1 deletion themes/hexo/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const CONFIG = {
HEXO_HOME_BANNER_ENABLE: true,
// 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。
HEXO_HOME_BANNER_GREETINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字
HEXO_HOME_BANNER_GREETINGS: [
'Hi,我是一个程序员',
'Hi,我是一个打工人',
'Hi,我是一个干饭人',
'欢迎来到我的博客🎉'
], // 首页大图标语文字

HEXO_HOME_NAV_BUTTONS: true, // 首页是否显示分类大图标按钮
// 已知未修复bug, 在移动端开启true后会加载不出图片; 暂时建议设置为false。
@@ -15,6 +20,7 @@ const CONFIG = {
HEXO_MENU_TAG: true, // 显示标签
HEXO_MENU_ARCHIVE: true, // 显示归档
HEXO_MENU_SEARCH: true, // 显示搜索
HEXO_MENU_RANDOM: true, // 显示随机跳转按钮

HEXO_POST_LIST_COVER: true, // 列表显示文章封面
HEXO_POST_LIST_COVER_HOVER_ENLARGE: false, // 列表鼠标悬停放大
10 changes: 7 additions & 3 deletions themes/hexo/index.js
Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@ import ArticleRecommend from './components/ArticleRecommend'
import BlogPostArchive from './components/BlogPostArchive'
import BlogPostListPage from './components/BlogPostListPage'
import BlogPostListScroll from './components/BlogPostListScroll'
import ButtonJumpToComment from './components/ButtonJumpToComment'
import ButtonRandomPostMini from './components/ButtonRandomPostMini'
import Card from './components/Card'
import Footer from './components/Footer'
import Header from './components/Header'
import Hero from './components/Hero'
import JumpToCommentButton from './components/JumpToCommentButton'
import PostHero from './components/PostHero'
import RightFloatArea from './components/RightFloatArea'
import SearchNav from './components/SearchNav'
@@ -51,8 +52,9 @@ export const useHexoGlobal = () => useContext(ThemeGlobalHexo)
const LayoutBase = props => {
const { post, children, slotTop, className } = props
const { onLoading, fullWidth } = useGlobal()

const router = useRouter()
const showRandomButton = siteConfig('HEXO_MENU_RANDOM', false, CONFIG)

const headerSlot = post ? (
<PostHero {...props} />
) : router.route === '/' &&
@@ -63,6 +65,7 @@ const LayoutBase = props => {
const drawerRight = useRef(null)
const tocRef = isBrowser ? document.getElementById('article-wrapper') : null

// 悬浮按钮内容
const floatSlot = (
<>
{post?.toc?.length > 1 && (
@@ -74,7 +77,8 @@ const LayoutBase = props => {
/>
</div>
)}
{post && <JumpToCommentButton />}
{post && <ButtonJumpToComment />}
{showRandomButton && <ButtonRandomPostMini {...props} />}
</>
)

0 comments on commit 9e59bd1

Please sign in to comment.