add Google AdSense auto-ads loader
Shares the same publisher account as qipaobuzz / hype404
(ca-pub-9763775565109295). site.ads = { enabled: true, publisherId };
Layout conditionally injects the adsbygoogle.js loader in <head> when
ads are enabled — Google auto-ads handles placement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
---
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -45,6 +46,14 @@ const year = new Date().getFullYear();
|
||||
|
||||
<link rel="alternate" type="application/rss+xml" title={`${site.name} RSS`} href="/rss.xml" />
|
||||
|
||||
{ads?.enabled && (
|
||||
<script
|
||||
async
|
||||
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-${ads.publisherId}`}
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
)}
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Bungee+Shade&family=Bungee&display=swap" rel="stylesheet" />
|
||||
|
||||
@@ -3,4 +3,8 @@ export const site = {
|
||||
description: "Where the internet's MVPs go viral",
|
||||
url: 'https://viralmvp.com',
|
||||
postsPerPage: 10,
|
||||
ads: {
|
||||
enabled: true,
|
||||
publisherId: '9763775565109295',
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user