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}
-
- -
}