From 1a961a1c685ed6638ae458c722cfd650f2e1d5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=81=A5=E8=8E=B9?= Date: Mon, 1 Apr 2024 22:49:13 +0800 Subject: [PATCH] chore: Add google ads --- website/astro.config.mjs | 11 +++------- website/public/ads.txt | 1 - .../starlight/TableOfContents.astro | 20 +++++++++++++++++++ website/src/env.d.ts | 6 ++++++ 4 files changed, 29 insertions(+), 9 deletions(-) delete mode 100644 website/public/ads.txt create mode 100644 website/src/components/starlight/TableOfContents.astro diff --git a/website/astro.config.mjs b/website/astro.config.mjs index 7510cff9..dcccca0c 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -93,6 +93,9 @@ export default defineConfig({ ], }, ], + components: { + TableOfContents: "./src/components/starlight/TableOfContents.astro", + }, head: [ { tag: "script", @@ -114,14 +117,6 @@ export default defineConfig({ gtag('config', '${googleAnalyticsId}'); `, }, - { - tag: "script", - attrs: { - src: `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6049036475236211`, - async: true, - crossorigin: "anonymous", - }, - }, ], }), tailwind({ diff --git a/website/public/ads.txt b/website/public/ads.txt deleted file mode 100644 index 47e85afa..00000000 --- a/website/public/ads.txt +++ /dev/null @@ -1 +0,0 @@ -google.com, pub-6049036475236211, DIRECT, f08c47fec0942fa0 \ No newline at end of file diff --git a/website/src/components/starlight/TableOfContents.astro b/website/src/components/starlight/TableOfContents.astro new file mode 100644 index 00000000..24f17143 --- /dev/null +++ b/website/src/components/starlight/TableOfContents.astro @@ -0,0 +1,20 @@ +--- +import type { Props } from "@astrojs/starlight/props"; +import AstrolightTableOfContents from "@astrojs/starlight/components/TableOfContents.astro"; +--- + + + + + diff --git a/website/src/env.d.ts b/website/src/env.d.ts index acef35f1..f1230e8c 100644 --- a/website/src/env.d.ts +++ b/website/src/env.d.ts @@ -1,2 +1,8 @@ /// /// + +declare let adsbygoogle: any; + +interface Window { + adsbygoogle: any; +}