Skip to content

Commit b4e40d8

Browse files
committed
gitbook wwads
1 parent ed5cbfc commit b4e40d8

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

blog.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ const BLOG = {
343343
ADSENSE_GOOGLE_SLOT_AUTO: process.env.NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_AUTO || '8807314373', // Google AdScene>广告>按单元广告>新建展示广告 (自动广告)
344344

345345
// 万维广告
346-
AD_WWADS_ENABLE: process.env.NEXT_PUBLIC_WWADS_ENABLE || false, // https://wwads.cn/
347-
AD_WWADS_BLOCK_DETECT: process.env.NEXT_PUBLIC_WWADS_AD_BLOCK_DETECT || false, // 是否开启WWADS广告屏蔽插件检测 @see https://github.com/bytegravity/whitelist-wwads
346+
AD_WWADS_ID: process.env.NEXT_PUBLIC_WWAD_ID || null, // https://wwads.cn/ 创建您的万维广告单元ID
347+
AD_WWADS_BLOCK_DETECT: process.env.NEXT_PUBLIC_WWADS_AD_BLOCK_DETECT || false, // 是否开启WWADS广告屏蔽插件检测,开启后会在广告位上以文字提示 @see https://github.com/bytegravity/whitelist-wwads
348348

349349
// END<----营收相关
350350

components/CommonScript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const CommonScript = () => {
3838
/>
3939
</>)}
4040

41-
{BLOG.AD_WWADS_ENABLE && <script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>}
41+
{BLOG.AD_WWADS_ID && <script type="text/javascript" charSet="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>}
4242

4343
{BLOG.COMMENT_CUSDIS_APP_ID && <script defer src={`https://cusdis.com/js/widget/lang/${BLOG.LANG.toLowerCase()}.js`} />}
4444

components/WWAds.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import BLOG from '@/blog.config'
88
* @returns {JSX.Element | null} - 返回渲染的 JSX 元素或 null
99
*/
1010
export default function WWAds({ orientation = 'vertical', sticky = false, className }) {
11-
if (!JSON.parse(BLOG.AD_WWADS_ENABLE)) {
11+
if (!JSON.parse(BLOG.AD_WWADS_ID)) {
1212
return null
1313
}
1414

1515
return (
16-
<div className={`wwads-cn ${orientation === 'vertical' ? 'wwads-vertical' : 'wwads-horizontal'} ${sticky ? 'wwads-sticky' : ''} z-30 ${className || ''}`} data-id="265"></div>
16+
<div className={`wwads-cn ${orientation === 'vertical' ? 'wwads-vertical' : 'wwads-horizontal'} ${sticky ? 'wwads-sticky' : ''} z-30 ${className || ''}`} data-id={BLOG.AD_WWADS_ID}></div>
1717
)
1818
}

themes/gitbook/components/MenuBarMobile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const MenuBarMobile = (props) => {
3232
return (
3333
<nav id='nav' className=' text-md'>
3434
{/* {links.map(link => <NormalMenu key={link?.id} link={link}/>)} */}
35-
{links?.map(link => <MenuItemCollapse onHeightChange={props.onHeightChange} key={link?.id} link={link}/>)}
35+
{links?.map((link, index) => <MenuItemCollapse onHeightChange={props.onHeightChange} key={index} link={link}/>)}
3636

3737
</nav>
3838
)

themes/gitbook/components/MenuItemCollapse.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export const MenuItemCollapse = (props) => {
4747

4848
{/* 折叠子菜单 */}
4949
{hasSubMenu && <Collapse isOpen={isOpen} onHeightChange={props.onHeightChange}>
50-
{link?.subMenus?.map(sLink => {
51-
return <div key={sLink.id} className='
50+
{link?.subMenus?.map((sLink, index) => {
51+
return <div key={index} className='
5252
not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-200
5353
font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'>
5454
<Link href={sLink.to} target={link?.to?.indexOf('http') === 0 ? '_blank' : '_self'}>

themes/gitbook/components/TopNavBar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function TopNavBar(props) {
6464

6565
{/* 桌面端顶部菜单 */}
6666
<div className='hidden md:flex'>
67-
{links && links?.map(link => <MenuItemDrop key={link?.id} link={link} />)}
67+
{links && links?.map((link, index) => <MenuItemDrop key={index} link={link} />)}
6868
<DarkModeButton className='text-sm flex items-center h-full' />
6969
</div>
7070
</div>

0 commit comments

Comments
 (0)