Skip to content

Commit 710fadd

Browse files
committed
Update Adsense config
1 parent a80d219 commit 710fadd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

quartz.layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export const sharedPageComponents: SharedLayout = {
88
afterBody: [
99
Component.DesktopOnly(
1010
Component.Adsense({
11-
client:"ca-pub-1829817529831781"
11+
clientId: "ca-pub-1829817529831781",
12+
slotId: "7543380157"
1213
})
1314
),
1415
Component.Comments({

quartz/components/Adsense.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
22

33
interface Options {
4-
client: string
4+
clientId: string,
5+
slotId: String
56
}
67

78
const defaultOptions: Options = {
8-
client: "ca-pub-1829817529831781",
9+
clientId: "ca-pub-1829817529831781",
10+
slotId: "7543380157"
911
}
1012

1113
export default ((opts: Options) => {
@@ -14,13 +16,13 @@ export default ((opts: Options) => {
1416
<div>
1517
<script
1618
async
17-
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${opts.client}`}
19+
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${opts.clientId}`}
1820
crossorigin="anonymous">
1921
</script>
2022
<ins class="adsbygoogle"
2123
style="display:block"
22-
data-ad-client={`${opts.client}`}
23-
data-ad-slot="7543380157"
24+
data-ad-client={`${opts.clientId}`}
25+
data-ad-slot={`${opts.slotId}`}
2426
data-ad-format="auto"
2527
data-full-width-responsive="true"></ins>
2628
<script>
@@ -29,6 +31,5 @@ export default ((opts: Options) => {
2931
</div>
3032
)
3133
}
32-
3334
return Adsense
3435
}) satisfies QuartzComponentConstructor<Options>

0 commit comments

Comments
 (0)