diff --git a/themes/hexo/components/SideRight.js b/themes/hexo/components/SideRight.js index 73d26593..bad000c1 100644 --- a/themes/hexo/components/SideRight.js +++ b/themes/hexo/components/SideRight.js @@ -1,16 +1,16 @@ -import Card from './Card' -import CategoryGroup from './CategoryGroup' -import LatestPostsGroup from './LatestPostsGroup' -import TagGroups from './TagGroups' -import Catalog from './Catalog' -import { InfoCard } from './InfoCard' -import { AnalyticsCard } from './AnalyticsCard' -import CONFIG from '../config' -import dynamic from 'next/dynamic' -import Announcement from './Announcement' -import { useGlobal } from '@/lib/global' import Live2D from '@/components/Live2D' import { siteConfig } from '@/lib/config' +import { useGlobal } from '@/lib/global' +import dynamic from 'next/dynamic' +import CONFIG from '../config' +import { AnalyticsCard } from './AnalyticsCard' +import Announcement from './Announcement' +import Card from './Card' +import Catalog from './Catalog' +import CategoryGroup from './CategoryGroup' +import { InfoCard } from './InfoCard' +import LatestPostsGroup from './LatestPostsGroup' +import TagGroups from './TagGroups' const HexoRecentComments = dynamic(() => import('./HexoRecentComments')) const FaceBookPage = dynamic( @@ -33,8 +33,17 @@ const FaceBookPage = dynamic( */ export default function SideRight(props) { const { - post, currentCategory, categories, latestPosts, tags, - currentTag, showCategory, showTag, rightAreaSlot, notice, className + post, + currentCategory, + categories, + latestPosts, + tags, + currentTag, + showCategory, + showTag, + rightAreaSlot, + notice, + className } = props const { locale } = useGlobal() @@ -45,44 +54,54 @@ export default function SideRight(props) { } return ( -
- - {siteConfig('HEXO_WIDGET_ANALYTICS', null, CONFIG) && } +
+
+ {post && post.toc && post.toc.length > 1 && ( + + + + )} - {showCategory && ( - -
- {locale.COMMON.CATEGORY} -
- -
- )} - {showTag && ( - - - - )} - {siteConfig('HEXO_WIDGET_LATEST_POSTS', null, CONFIG) && latestPosts && latestPosts.length > 0 && - - } + + {siteConfig('HEXO_WIDGET_ANALYTICS', null, CONFIG) && ( + + )} - + {showCategory && ( + +
+ {locale.COMMON.CATEGORY} +
+ +
+ )} + {showTag && ( + + + + )} + {siteConfig('HEXO_WIDGET_LATEST_POSTS', null, CONFIG) && + latestPosts && + latestPosts.length > 0 && ( + + + + )} - {siteConfig('COMMENT_WALINE_SERVER_URL') && siteConfig('COMMENT_WALINE_RECENT') && } + -
- {post && post.toc && post.toc.length > 1 && - - } + {siteConfig('COMMENT_WALINE_SERVER_URL') && + siteConfig('COMMENT_WALINE_RECENT') && } {rightAreaSlot} - +
-
) } diff --git a/themes/hexo/index.js b/themes/hexo/index.js index 4988dad9..d478dbc3 100644 --- a/themes/hexo/index.js +++ b/themes/hexo/index.js @@ -141,10 +141,7 @@ const LayoutBase = props => {
{/* 右侧栏 */} - +