mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
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:
parent
0870571765
commit
afbe6abaaf
2 changed files with 18 additions and 2 deletions
18
surfsense_web/app/(home)/free/layout.tsx
Normal file
18
surfsense_web/app/(home)/free/layout.tsx
Normal 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}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,6 @@ import type { Metadata } from "next";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { AdUnit } from "@/components/ads/ad-unit";
|
import { AdUnit } from "@/components/ads/ad-unit";
|
||||||
import { ADSENSE_SLOTS } from "@/components/ads/adsense-config";
|
import { ADSENSE_SLOTS } from "@/components/ads/adsense-config";
|
||||||
import { AdSenseScript } from "@/components/ads/adsense-script";
|
|
||||||
import { BreadcrumbNav } from "@/components/seo/breadcrumb-nav";
|
import { BreadcrumbNav } from "@/components/seo/breadcrumb-nav";
|
||||||
import { FAQJsonLd, JsonLd } from "@/components/seo/json-ld";
|
import { FAQJsonLd, JsonLd } from "@/components/seo/json-ld";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
|
|
@ -160,7 +159,6 @@ export default async function FreeHubPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen pt-20">
|
<div className="min-h-screen pt-20">
|
||||||
<AdSenseScript />
|
|
||||||
<JsonLd
|
<JsonLd
|
||||||
data={{
|
data={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue