Skip to content

Commit 348dade

Browse files
committed
feat: add google analysis
1 parent ab4b847 commit 348dade

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

src/.vuepress/config.ts

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
1-
import { viteBundler } from "@vuepress/bundler-vite";
2-
import { defineUserConfig } from "vuepress";
1+
import {viteBundler} from "@vuepress/bundler-vite";
2+
import {defineUserConfig} from "vuepress";
33
import theme from "./theme.js";
44

55
export default defineUserConfig({
6-
base: "/",
7-
lang: "zh-CN",
8-
title: "Golang 中文学习文档",
9-
description: "Go 爱好者驱动的中文学习文档",
6+
base: "/",
7+
lang: "zh-CN",
8+
title: "Golang 中文学习文档",
9+
description: "Go 爱好者驱动的中文学习文档",
1010

11-
head: [
12-
[
13-
"script",
14-
{},
15-
`var _hmt = _hmt || [];
11+
head: [
12+
[
13+
"script",
14+
{},
15+
`var _hmt = _hmt || [];
1616
(function() {
1717
var hm = document.createElement("script");
1818
hm.src = "https://hm.baidu.com/hm.js?87d678935e4b33455c0390543e7a759d";
1919
var s = document.getElementsByTagName("script")[0];
2020
s.parentNode.insertBefore(hm, s);
2121
})();`,
22+
],
23+
[
24+
"script",
25+
{
26+
async: true,
27+
src: "https://www.googletagmanager.com/gtag/js?id=G-6K9H75LPZG"
28+
}
29+
],
30+
[
31+
"script",
32+
{},
33+
`window.dataLayer = window.dataLayer || [];
34+
function gtag(){dataLayer.push(arguments);}
35+
gtag('js', new Date());
36+
37+
gtag('config', 'G-6K9H75LPZG');`
38+
],
2239
],
23-
],
2440

25-
bundler: viteBundler(),
26-
theme,
41+
bundler: viteBundler(),
42+
theme,
2743

28-
shouldPrefetch: false,
29-
pagePatterns: ["**/*.md", "!**/*.snippet.md", "!.vuepress", "!node_modules"],
44+
shouldPrefetch: false,
45+
pagePatterns: ["**/*.md", "!**/*.snippet.md", "!.vuepress", "!node_modules"],
3046
});

0 commit comments

Comments
 (0)