Skip to content

Commit

Permalink
gitbook wwads
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Aug 18, 2023
1 parent ed5cbfc commit b4e40d8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ const BLOG = {
ADSENSE_GOOGLE_SLOT_AUTO: process.env.NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_AUTO || '8807314373', // Google AdScene>广告>按单元广告>新建展示广告 (自动广告)

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

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

Expand Down
2 changes: 1 addition & 1 deletion components/CommonScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const CommonScript = () => {
/>
</>)}

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

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

Expand Down
4 changes: 2 additions & 2 deletions components/WWAds.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import BLOG from '@/blog.config'
* @returns {JSX.Element | null} - 返回渲染的 JSX 元素或 null
*/
export default function WWAds({ orientation = 'vertical', sticky = false, className }) {
if (!JSON.parse(BLOG.AD_WWADS_ENABLE)) {
if (!JSON.parse(BLOG.AD_WWADS_ID)) {
return null
}

return (
<div className={`wwads-cn ${orientation === 'vertical' ? 'wwads-vertical' : 'wwads-horizontal'} ${sticky ? 'wwads-sticky' : ''} z-30 ${className || ''}`} data-id="265"></div>
<div className={`wwads-cn ${orientation === 'vertical' ? 'wwads-vertical' : 'wwads-horizontal'} ${sticky ? 'wwads-sticky' : ''} z-30 ${className || ''}`} data-id={BLOG.AD_WWADS_ID}></div>
)
}
2 changes: 1 addition & 1 deletion themes/gitbook/components/MenuBarMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const MenuBarMobile = (props) => {
return (
<nav id='nav' className=' text-md'>
{/* {links.map(link => <NormalMenu key={link?.id} link={link}/>)} */}
{links?.map(link => <MenuItemCollapse onHeightChange={props.onHeightChange} key={link?.id} link={link}/>)}
{links?.map((link, index) => <MenuItemCollapse onHeightChange={props.onHeightChange} key={index} link={link}/>)}

</nav>
)
Expand Down
4 changes: 2 additions & 2 deletions themes/gitbook/components/MenuItemCollapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const MenuItemCollapse = (props) => {

{/* 折叠子菜单 */}
{hasSubMenu && <Collapse isOpen={isOpen} onHeightChange={props.onHeightChange}>
{link?.subMenus?.map(sLink => {
return <div key={sLink.id} className='
{link?.subMenus?.map((sLink, index) => {
return <div key={index} className='
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
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'>
<Link href={sLink.to} target={link?.to?.indexOf('http') === 0 ? '_blank' : '_self'}>
Expand Down
2 changes: 1 addition & 1 deletion themes/gitbook/components/TopNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function TopNavBar(props) {

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

0 comments on commit b4e40d8

Please sign in to comment.