refactor(page): remove AdSenseScript component from FreeHubPage

- Eliminated the AdSenseScript import and its usage in the FreeHubPage component to streamline the code and improve performance.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-06-03 16:11:33 -07:00
parent 0870571765
commit afbe6abaaf
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",