Skip to content

Commit 283dec0

Browse files
committed
feat: add google analytics
1 parent 31baec5 commit 283dec0

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

docs/.vitepress/config.mts

+28-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ export default defineConfig({
2121
prev: '上一页',
2222
next: '下一页'
2323
},
24+
editLink: {
25+
pattern: 'https://github.com/doocs/jvm/edit/main/docs/:path',
26+
text: '在 GitHub 编辑'
27+
},
28+
lastUpdated: {
29+
text: 'Updated at',
30+
formatOptions: {
31+
dateStyle: 'full',
32+
timeStyle: 'medium'
33+
}
34+
},
2435
sidebar: [
2536
{
2637
items: [
@@ -75,5 +86,21 @@ export default defineConfig({
7586
socialLinks: [
7687
{ icon: 'github', link: 'https://github.com/doocs/jvm' }
7788
]
78-
}
89+
},
90+
head: [
91+
['link', { rel: 'icon', href: '/favicon.ico' }],
92+
[
93+
'script',
94+
{ async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-7W625EPRG6' }
95+
],
96+
[
97+
'script',
98+
{},
99+
`window.dataLayer = window.dataLayer || [];
100+
function gtag(){dataLayer.push(arguments);}
101+
gtag('js', new Date());
102+
gtag('config', 'G-7W625EPRG6');`
103+
]
104+
],
105+
cleanUrls: true,
79106
})

docs/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ hero:
66
name: "JVM 底层原理最全知识总结"
77
tagline:
88
actions:
9-
- theme: brand
10-
text: 开始学习
11-
link: /00-quickstart
129
- theme: alt
1310
text: 作者主页
1411
link: https://github.com/yanglbme
12+
- theme: brand
13+
text: 开始学习
14+
link: /00-quickstart
1515

1616
features:
1717
- title: JVM 内存结构

0 commit comments

Comments
 (0)