Skip to content

Commit bfcca16

Browse files
committed
heo 广告微调
1 parent 461f6f3 commit bfcca16

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

next.config.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,21 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
88
})
99

1010
/**
11-
* 扫描指定目录下的文件夹名,用于获取当前有几个主题
11+
* 扫描指定目录下的文件夹名,用于获取所有主题
1212
* @param {*} directory
1313
* @returns
1414
*/
1515
function scanSubdirectories(directory) {
1616
const subdirectories = []
1717

1818
fs.readdirSync(directory).forEach(file => {
19-
// 这段代码会将landing排除在可选主题中
20-
21-
// const fullPath = path.join(directory, file)
22-
// const stats = fs.statSync(fullPath)
23-
// landing主题默认隐藏掉,一般网站不会用到
24-
// if (stats.isDirectory() && file !== 'landing') {
25-
// subdirectories.push(file)
26-
// }
19+
const fullPath = path.join(directory, file)
20+
const stats = fs.statSync(fullPath)
21+
if (stats.isDirectory()) {
22+
subdirectories.push(file)
23+
}
2724

28-
subdirectories.push(file)
25+
// subdirectories.push(file)
2926
})
3027

3128
return subdirectories

themes/heo/components/SideRight.js

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export default function SideRight(props) {
3838
<InfoCard {...props} className='w-72' />
3939

4040
<div className='sticky top-20 space-y-4'>
41+
42+
{/* 文章页显示目录 */}
4143
{post && post.toc && post.toc.length > 0 && (
4244
<Card className='bg-white dark:bg-[#1e1e1e]'>
4345
<Catalog toc={post.toc} />

themes/heo/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,17 @@ const LayoutSlug = props => {
310310
? null
311311
: <div className={`${commentEnable && post ? '' : 'hidden'}`}>
312312
<hr className="my-4 border-dashed" />
313-
313+
{/* 评论区上方广告 */}
314+
<div className="py-2">
315+
<AdSlot />
316+
</div>
314317
{/* 评论互动 */}
315318
<div className="duration-200 overflow-x-auto px-5">
316319
<div className="text-2xl dark:text-white">
317320
<i className="fas fa-comment mr-1" />
318321
{locale.COMMON.COMMENTS}
319322
</div>
320323
<Comment frontMatter={post} className="" />
321-
<div className="py-2">
322-
<AdSlot />
323-
</div>
324324
</div>
325325
</div>}
326326
</div>

0 commit comments

Comments
 (0)