From bfcca16a86d4e86e1546bb384d8c22439aacf784 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 19 Feb 2024 11:51:39 +0800 Subject: [PATCH] =?UTF-8?q?heo=20=E5=B9=BF=E5=91=8A=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.js | 17 +++++++---------- themes/heo/components/SideRight.js | 2 ++ themes/heo/index.js | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/next.config.js b/next.config.js index 732303bf..fd0130ec 100644 --- a/next.config.js +++ b/next.config.js @@ -8,7 +8,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({ }) /** - * 扫描指定目录下的文件夹名,用于获取当前有几个主题 + * 扫描指定目录下的文件夹名,用于获取所有主题 * @param {*} directory * @returns */ @@ -16,16 +16,13 @@ function scanSubdirectories(directory) { const subdirectories = [] fs.readdirSync(directory).forEach(file => { - // 这段代码会将landing排除在可选主题中 + const fullPath = path.join(directory, file) + const stats = fs.statSync(fullPath) + if (stats.isDirectory()) { + subdirectories.push(file) + } - // const fullPath = path.join(directory, file) - // const stats = fs.statSync(fullPath) - // landing主题默认隐藏掉,一般网站不会用到 - // if (stats.isDirectory() && file !== 'landing') { - // subdirectories.push(file) - // } - - subdirectories.push(file) + // subdirectories.push(file) }) return subdirectories diff --git a/themes/heo/components/SideRight.js b/themes/heo/components/SideRight.js index ec1d4fb7..775b9b76 100644 --- a/themes/heo/components/SideRight.js +++ b/themes/heo/components/SideRight.js @@ -38,6 +38,8 @@ export default function SideRight(props) {
+ + {/* 文章页显示目录 */} {post && post.toc && post.toc.length > 0 && ( diff --git a/themes/heo/index.js b/themes/heo/index.js index 54d328ed..239f30dc 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -310,7 +310,10 @@ const LayoutSlug = props => { ? null :

- + {/* 评论区上方广告 */} +
+ +
{/* 评论互动 */}
@@ -318,9 +321,6 @@ const LayoutSlug = props => { {locale.COMMON.COMMENTS}
-
- -
}