Skip to content

Commit

Permalink
heo 广告微调
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Feb 19, 2024
1 parent 461f6f3 commit bfcca16
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
17 changes: 7 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,21 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
})

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

fs.readdirSync(directory).forEach(file => {
// 这段代码会将landing排除在可选主题中

// const fullPath = path.join(directory, file)
// const stats = fs.statSync(fullPath)
// landing主题默认隐藏掉,一般网站不会用到
// if (stats.isDirectory() && file !== 'landing') {
// subdirectories.push(file)
// }
const fullPath = path.join(directory, file)
const stats = fs.statSync(fullPath)
if (stats.isDirectory()) {
subdirectories.push(file)
}

subdirectories.push(file)
// subdirectories.push(file)
})

return subdirectories
Expand Down
2 changes: 2 additions & 0 deletions themes/heo/components/SideRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default function SideRight(props) {
<InfoCard {...props} className='w-72' />

<div className='sticky top-20 space-y-4'>

{/* 文章页显示目录 */}
{post && post.toc && post.toc.length > 0 && (
<Card className='bg-white dark:bg-[#1e1e1e]'>
<Catalog toc={post.toc} />
Expand Down
8 changes: 4 additions & 4 deletions themes/heo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,17 @@ const LayoutSlug = props => {
? null
: <div className={`${commentEnable && post ? '' : 'hidden'}`}>
<hr className="my-4 border-dashed" />

{/* 评论区上方广告 */}
<div className="py-2">
<AdSlot />
</div>
{/* 评论互动 */}
<div className="duration-200 overflow-x-auto px-5">
<div className="text-2xl dark:text-white">
<i className="fas fa-comment mr-1" />
{locale.COMMON.COMMENTS}
</div>
<Comment frontMatter={post} className="" />
<div className="py-2">
<AdSlot />
</div>
</div>
</div>}
</div>
Expand Down

0 comments on commit bfcca16

Please sign in to comment.