Slots to disable ads from homepage

This commit is contained in:
Kamran Ahmed
2025-09-15 11:53:47 +01:00
parent 06a0fc2222
commit 73fe2abd7d
4 changed files with 17 additions and 2 deletions

View File

@@ -7,6 +7,9 @@ const props = Astro.props;
---
<BaseLayout {...props} noIndex={true}>
<div slot='ad-slot-script'></div>
<div slot='ad-slot'></div>
<slot />
<div slot='login-popup'></div>
<div slot='page-footer'></div>

View File

@@ -183,7 +183,10 @@ const gaPageIdentifier = Astro.url.pathname
}
<Analytics />
<GoogleAd />
<slot name='ad-slot-script'>
<GoogleAd />
</slot>
{
!import.meta.env.DEV && (
@@ -235,7 +238,10 @@ const gaPageIdentifier = Astro.url.pathname
<PageProgress initialMessage={initialLoadingMessage} client:idle />
<GlobalUpgradeModal client:only='react' />
<GoogleAdSlot />
<slot name='ad-slot'>
<GoogleAdSlot />
</slot>
<slot name='after-footer' />
<PageVisit

View File

@@ -7,6 +7,9 @@ const props = Astro.props;
---
<BaseLayout {...props}>
<div slot='ad-slot-script'></div>
<div slot='ad-slot'></div>
<div slot='course-announcement'></div>
<div slot='page-header'></div>
<slot />

View File

@@ -48,6 +48,9 @@ const videos = await getAllVideos();
description={'Community driven roadmaps, articles and guides for developers to grow in their career.'}
permalink={'/'}
>
<div slot='ad-slot-script'></div>
<div slot='ad-slot'></div>
<div class='bg-linear-to-b from-slate-900 to-black'>
<HeroSection />