Merge pull request #1465 from MODSetter/docker-hot-patch

refactor(page): remove AdSenseScript
This commit is contained in:
Rohan Verma 2026-06-03 16:14:45 -07:00 committed by GitHub
commit ae0e61305c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View file

@ -0,0 +1,18 @@
import type { ReactNode } from "react";
import { AdSenseScript } from "@/components/ads/adsense-script";
/**
* Wraps the /free hub and all /free/[model_slug] subpages. Mounting
* <AdSenseScript /> here loads adsbygoogle.js across the entire /free route
* tree, which is what powers both the manual <AdUnit /> slots and AdSense
* Auto ads. Because the script lives here (not in the root layout), Auto ads
* is naturally scoped to /free and its subpages only.
*/
export default function FreeSectionLayout({ children }: { children: ReactNode }) {
return (
<>
<AdSenseScript />
{children}
</>
);
}

View file

@ -3,7 +3,6 @@ import type { Metadata } from "next";
import Link from "next/link";
import { AdUnit } from "@/components/ads/ad-unit";
import { ADSENSE_SLOTS } from "@/components/ads/adsense-config";
import { AdSenseScript } from "@/components/ads/adsense-script";
import { BreadcrumbNav } from "@/components/seo/breadcrumb-nav";
import { FAQJsonLd, JsonLd } from "@/components/seo/json-ld";
import { Badge } from "@/components/ui/badge";
@ -160,7 +159,6 @@ export default async function FreeHubPage() {
return (
<div className="min-h-screen pt-20">
<AdSenseScript />
<JsonLd
data={{
"@context": "https://schema.org",