From b18887a8f3769ea68ecdc7da419c0a14671fa8ee Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 1 May 2026 18:30:44 +0800 Subject: [PATCH] add Google AdSense auto-ads loader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shares the same publisher account as qipaobuzz / hype404 (ca-pub-9763775565109295). site.ads = { enabled: true, publisherId }; Layout conditionally injects the adsbygoogle.js loader in when ads are enabled — Google auto-ads handles placement. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/layouts/Layout.astro | 9 +++++++++ src/lib/site.js | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 7232b4a..2b64a19 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -12,6 +12,7 @@ const { const pageTitle = title || site.name; const ogUrl = canonical || Astro.url.toString(); const year = new Date().getFullYear(); +const ads = site.ads; --- @@ -45,6 +46,14 @@ const year = new Date().getFullYear(); + {ads?.enabled && ( +