From a1582991576462568d31fdecdd9718ca7c06011b Mon Sep 17 00:00:00 2001 From: Samgu Lee Date: Thu, 18 Jun 2026 15:00:20 +0900 Subject: [PATCH 1/3] chore: insert google analytics --- src/components/GoogleTag.astro | 22 ++++++++++++++++++++++ src/layouts/BaseLayout.astro | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 src/components/GoogleTag.astro diff --git a/src/components/GoogleTag.astro b/src/components/GoogleTag.astro new file mode 100644 index 0000000..f7d5606 --- /dev/null +++ b/src/components/GoogleTag.astro @@ -0,0 +1,22 @@ +--- +// Frontmatter 영역에서 프로덕션 환경인지 확인 +const isProd = import.meta.env.PROD; +--- +{isProd && ( + <> + + + + +)} diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 39e1a7d..72713e5 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -2,6 +2,7 @@ import '../styles/global.css'; import ThemeToggle from '../components/ThemeToggle.astro'; import Link from '../components/Link.astro'; +import GoogleTag from '../components/GoogleTag.astro'; interface Props { title?: string; @@ -72,6 +73,7 @@ const brandHref = isEnglish ? '/en/' : '/'; document.documentElement.classList.remove('dark'); } +
Date: Thu, 18 Jun 2026 15:00:45 +0900 Subject: [PATCH 2/3] docs: add `Astro Rules` to `AGENTS.md` --- AGENTS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 255d903..198762d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,6 +19,14 @@ Use Astro conventions: --- +## Astro Rules + +- Use Astro stable APIs only +- Do not use experimental features +- Avoid latest syntax unless verified + +--- + ## Rules Prefer: From 2b961c005207ab414c939a0b46fc6e1f45fa406e Mon Sep 17 00:00:00 2001 From: Samgu Lee Date: Thu, 18 Jun 2026 15:12:21 +0900 Subject: [PATCH 3/3] fix: astro format --- src/components/GoogleTag.astro | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/GoogleTag.astro b/src/components/GoogleTag.astro index f7d5606..b52c3e3 100644 --- a/src/components/GoogleTag.astro +++ b/src/components/GoogleTag.astro @@ -2,21 +2,26 @@ // Frontmatter 영역에서 프로덕션 환경인지 확인 const isProd = import.meta.env.PROD; --- -{isProd && ( - <> - - - - -)} + `} + /> + + ) +}