-
- {siteConfig('CONTACT_GITHUB') &&
-
- }
- {siteConfig('CONTACT_TWITTER') &&
-
- }
- {siteConfig('CONTACT_TELEGRAM') &&
-
- }
- {siteConfig('CONTACT_LINKEDIN') &&
-
- }
- {siteConfig('CONTACT_WEIBO') &&
-
- }
- {siteConfig('CONTACT_INSTAGRAM') &&
-
- }
- {siteConfig('CONTACT_EMAIL') &&
-
- }
- {JSON.parse(siteConfig('ENABLE_RSS')) &&
-
- }
- {siteConfig('CONTACT_BILIBILI') &&
-
- }
- {siteConfig('CONTACT_YOUTUBE') &&
-
- }
+ 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 (
+
-
+ )
}
export default SocialButton
diff --git a/themes/hexo/config.js b/themes/hexo/config.js
index dddfbe8382d..024c12e08eb 100644
--- a/themes/hexo/config.js
+++ b/themes/hexo/config.js
@@ -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, // 列表鼠标悬停放大
diff --git a/themes/hexo/index.js b/themes/hexo/index.js
index 8dd08ec92c3..4988dad9dd1 100644
--- a/themes/hexo/index.js
+++ b/themes/hexo/index.js
@@ -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 ? (
) : 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 => {
/>
)}
- {post &&