From 4acc459c08633033e75e6eb1beea38e049f940d8 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 30 Dec 2023 17:49:51 +0800 Subject: [PATCH] =?UTF-8?q?heo=20=E6=94=AF=E6=8C=81fullWidth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/heo/index.js | 70 ++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/themes/heo/index.js b/themes/heo/index.js index 241c66ec..91e8be07 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -57,6 +57,10 @@ const LayoutBase = props => { meta } = props + // 全屏模式下的最大宽度 + const { fullWidth } = useGlobal() + const maxWidth = fullWidth ? 'max-w-[86rem]' : 'max-w-[86rem]' // 最大宽度都是86rem,和顶部菜单栏对齐,设置成空则与网页对齐 + return (
{ {/* 主区块 */}
{ {siteConfig('POST_LIST_STYLE') === 'page' ? ( - + ) : ( - + )}
@@ -165,10 +169,10 @@ const LayoutPostList = props => { {siteConfig('POST_LIST_STYLE') === 'page' ? ( - + ) : ( - + )}
@@ -218,18 +222,18 @@ const LayoutSearch = props => {
{!currentSearch ? ( - + ) : ( -
- {siteConfig('POST_LIST_STYLE') === 'page' - ? ( - - ) - : ( - - )} -
+
+ {siteConfig('POST_LIST_STYLE') === 'page' + ? ( + + ) + : ( + + )} +
)}
@@ -311,8 +315,8 @@ const LayoutSlug = props => { ) const commentEnable = siteConfig('COMMENT_TWIKOO_ENV_ID') || siteConfig('COMMENT_WALINE_SERVER_URL') || siteConfig('COMMENT_VALINE_APP_ID') || - siteConfig('COMMENT_GISCUS_REPO') || siteConfig('COMMENT_CUSDIS_APP_ID') || siteConfig('COMMENT_UTTERRANCES_REPO') || - siteConfig('COMMENT_GITALK_CLIENT_ID') || siteConfig('COMMENT_WEBMENTION_ENABLE') + siteConfig('COMMENT_GISCUS_REPO') || siteConfig('COMMENT_CUSDIS_APP_ID') || siteConfig('COMMENT_UTTERRANCES_REPO') || + siteConfig('COMMENT_GITALK_CLIENT_ID') || siteConfig('COMMENT_WEBMENTION_ENABLE') return ( { )} -
-
+ {fullWidth + ? null + :
+
- {/* 评论互动 */} -
-
- - {locale.COMMON.COMMENTS} + {/* 评论互动 */} +
+
+ + {locale.COMMON.COMMENTS} +
+ +
+ +
- -
- -
-
-
+
}
)} @@ -390,7 +396,7 @@ const LayoutSlug = props => { */ const Layout404 = props => { const { meta, siteInfo } = props - const { onLoading } = useGlobal() + const { onLoading, fullWidth } = useGlobal() return (
{ {/* 主区块 */}