diff --git a/surfsense_web/app/(home)/free/layout.tsx b/surfsense_web/app/(home)/free/layout.tsx new file mode 100644 index 000000000..9447d34dd --- /dev/null +++ b/surfsense_web/app/(home)/free/layout.tsx @@ -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 + * here loads adsbygoogle.js across the entire /free route + * tree, which is what powers both the manual 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 ( + <> + + {children} + + ); +} diff --git a/surfsense_web/app/(home)/free/page.tsx b/surfsense_web/app/(home)/free/page.tsx index 5cea9b6d2..89a4735ae 100644 --- a/surfsense_web/app/(home)/free/page.tsx +++ b/surfsense_web/app/(home)/free/page.tsx @@ -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 (
-