File tree 3 files changed +13
-14
lines changed
3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,21 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
8
8
} )
9
9
10
10
/**
11
- * 扫描指定目录下的文件夹名,用于获取当前有几个主题
11
+ * 扫描指定目录下的文件夹名,用于获取所有主题
12
12
* @param {* } directory
13
13
* @returns
14
14
*/
15
15
function scanSubdirectories ( directory ) {
16
16
const subdirectories = [ ]
17
17
18
18
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
+ }
27
24
28
- subdirectories . push ( file )
25
+ // subdirectories.push(file)
29
26
} )
30
27
31
28
return subdirectories
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ export default function SideRight(props) {
38
38
< InfoCard { ...props } className = 'w-72' />
39
39
40
40
< div className = 'sticky top-20 space-y-4' >
41
+
42
+ { /* 文章页显示目录 */ }
41
43
{ post && post . toc && post . toc . length > 0 && (
42
44
< Card className = 'bg-white dark:bg-[#1e1e1e]' >
43
45
< Catalog toc = { post . toc } />
Original file line number Diff line number Diff line change @@ -310,17 +310,17 @@ const LayoutSlug = props => {
310
310
? null
311
311
: < div className = { `${ commentEnable && post ? '' : 'hidden' } ` } >
312
312
< hr className = "my-4 border-dashed" />
313
-
313
+ { /* 评论区上方广告 */ }
314
+ < div className = "py-2" >
315
+ < AdSlot />
316
+ </ div >
314
317
{ /* 评论互动 */ }
315
318
< div className = "duration-200 overflow-x-auto px-5" >
316
319
< div className = "text-2xl dark:text-white" >
317
320
< i className = "fas fa-comment mr-1" />
318
321
{ locale . COMMON . COMMENTS }
319
322
</ div >
320
323
< Comment frontMatter = { post } className = "" />
321
- < div className = "py-2" >
322
- < AdSlot />
323
- </ div >
324
324
</ div >
325
325
</ div > }
326
326
</ div >
You can’t perform that action at this time.
0 commit comments