add Google AdSense auto-ads loader
Shares the same publisher account as qipaobuzz (ca-pub-9763775565109295).
site.ads = { enabled: true, publisherId: '9763775565109295' }; Layout
conditionally injects the adsbygoogle.js loader in <head> when ads are
enabled, letting Google's auto-ads system place units automatically
(no manual <ins> slots — start with auto-ads, can add explicit slots
later if specific placements are needed).
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 pageTitle = title || site.name;
|
||||||
const ogUrl = canonical || Astro.url.toString();
|
const ogUrl = canonical || Astro.url.toString();
|
||||||
const year = new Date().getFullYear();
|
const year = new Date().getFullYear();
|
||||||
|
const ads = site.ads;
|
||||||
---
|
---
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -44,6 +45,14 @@ const year = new Date().getFullYear();
|
|||||||
|
|
||||||
<link rel="alternate" type="application/rss+xml" title={`${site.name} RSS`} href="/rss.xml" />
|
<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.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<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;9..144,900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=VT323&family=Major+Mono+Display&display=swap" rel="stylesheet" />
|
<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;9..144,900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=VT323&family=Major+Mono+Display&display=swap" rel="stylesheet" />
|
||||||
|
|||||||
@@ -3,4 +3,8 @@ export const site = {
|
|||||||
description: 'Street culture · Anatomy of online hype, from peak to 404',
|
description: 'Street culture · Anatomy of online hype, from peak to 404',
|
||||||
url: 'https://hype404.com',
|
url: 'https://hype404.com',
|
||||||
postsPerPage: 10,
|
postsPerPage: 10,
|
||||||
|
ads: {
|
||||||
|
enabled: true,
|
||||||
|
publisherId: '9763775565109295',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user