Skip to content

Commit

Permalink
chore: Add google ads
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Apr 1, 2024
1 parent bdb8dc6 commit 5aafc02
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export default defineConfig({
],
},
],
components: {
TableOfContents: "./src/components/starlight/TableOfContents.astro",
},
head: [
{
tag: "script",
Expand Down
1 change: 0 additions & 1 deletion website/public/ads.txt

This file was deleted.

16 changes: 16 additions & 0 deletions website/src/components/starlight/TableOfContents.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import type { Props } from "@astrojs/starlight/props";
import AstrolightTableOfContents from "@astrojs/starlight/components/TableOfContents.astro";
---

<AstrolightTableOfContents {...Astro.props} />
<ins
class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6049036475236211"
data-ad-slot="3475386518"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
6 changes: 6 additions & 0 deletions website/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

declare let adsbygoogle: any;

interface Window {
adsbygoogle: any;
}

0 comments on commit 5aafc02

Please sign in to comment.