File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { generateSidebar } from "./plugins/sidebar";
33
44import { createAutoGeneratePostsPlugin } from "./plugins/posts" ;
55
6+ const GOOGLE_ANALYTICS_ID = "G-3XM039P5E6" ;
7+
68// https://vitepress.dev/reference/site-config
79export default defineConfig ( {
810 title : "🦷 ToothlessDev" ,
@@ -47,7 +49,6 @@ export default defineConfig({
4749 hostname : "https://toothlessdev.github.io/" ,
4850 } ,
4951
50- // URL 리라이트 설정 - /posts/* -> /pages/posts/*
5152 rewrites : {
5253 "pages/posts/index.md" : "posts/index.md" ,
5354 "pages/posts/:slug*" : "posts/:slug*" ,
@@ -58,4 +59,24 @@ export default defineConfig({
5859 vite : {
5960 plugins : [ createAutoGeneratePostsPlugin ( ) ] ,
6061 } ,
62+
63+ head : [
64+ [
65+ "script" ,
66+ {
67+ async : "" ,
68+ src : `https://www.googletagmanager.com/gtag/js?id=${ GOOGLE_ANALYTICS_ID } ` ,
69+ } ,
70+ ] ,
71+ [
72+ "script" ,
73+ { } ,
74+ `
75+ window.dataLayer = window.dataLayer || [];
76+ function gtag() { dataLayer.push(arguments); }
77+ gtag('js', new Date());
78+ gtag('config', '${ GOOGLE_ANALYTICS_ID } ');
79+ ` ,
80+ ] ,
81+ ] ,
6182} ) ;
You can’t perform that action at this time.
0 commit comments