From 2b2745d6698d717a9aaa71ad46c03a4395f89d30 Mon Sep 17 00:00:00 2001 From: Sammy Shear Date: Fri, 26 Jul 2024 11:43:33 -0400 Subject: [PATCH] google adsense --- src/components/GoogleAnalytics.astro | 36 ++++++++------- src/components/Posts.tsx | 44 +++++++++--------- src/content/config.ts | 12 ++--- src/layouts/Layout.astro | 68 ++++++++++++++-------------- 4 files changed, 81 insertions(+), 79 deletions(-) diff --git a/src/components/GoogleAnalytics.astro b/src/components/GoogleAnalytics.astro index 5cac619..92e1084 100644 --- a/src/components/GoogleAnalytics.astro +++ b/src/components/GoogleAnalytics.astro @@ -1,23 +1,25 @@ --- -type Props = { measurementId: string } -const props = Astro.props as Props -const measurementId = props.measurementId +type Props = { measurementId: string }; +const props = Astro.props as Props; +const measurementId = props.measurementId; --- + + type="text/partytown" + src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`} +> diff --git a/src/components/Posts.tsx b/src/components/Posts.tsx index 4194dfa..39343cc 100644 --- a/src/components/Posts.tsx +++ b/src/components/Posts.tsx @@ -1,29 +1,29 @@ import type { CollectionEntry } from "astro:content"; type Props = { - posts: CollectionEntry<"blog">[]; + posts: CollectionEntry<"blog">[]; }; export default function Posts({ posts }: Props) { - return ( -
- {posts.map((post: CollectionEntry<"blog">) => { - return ( - - {post.data.title} - - {post.data.author} - - - {post.data.publishedTime.toLocaleDateString()} - - - ); - })} -
- ); + return ( +
+ {posts.map((post: CollectionEntry<"blog">) => { + return ( + + {post.data.title} + + {post.data.author} + + + {post.data.publishedTime.toLocaleDateString()} + + + ); + })} +
+ ); } diff --git a/src/content/config.ts b/src/content/config.ts index 6839d7d..6b918b0 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -2,12 +2,12 @@ import { SITE } from "../config"; import { defineCollection, z } from "astro:content"; const blog = defineCollection({ - type: "content", - schema: z.object({ - author: z.string().default(SITE.author), - title: z.string(), - publishedTime: z.date() - }) + type: "content", + schema: z.object({ + author: z.string().default(SITE.author), + title: z.string(), + publishedTime: z.date() + }) }); export const collections = { blog }; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b0102b1..1692846 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -25,45 +25,45 @@ const { + {title} + + + - - - -