添加 GTM 配置

This commit is contained in:
YuCheng Hu 2025-04-10 11:45:31 -04:00
parent 9f3a529560
commit 4a40cf7783
2 changed files with 40 additions and 28 deletions

View File

@ -1,25 +1,25 @@
{
"hash": "4f72eb09",
"hash": "1ac10c96",
"configHash": "13abb75f",
"lockfileHash": "af60f8bb",
"browserHash": "7d90a516",
"lockfileHash": "6fd94679",
"browserHash": "2c7a1e81",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "4d0b2daa",
"fileHash": "1385bc56",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "3e6cf36b",
"fileHash": "25d1ec64",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "15f23fb4",
"fileHash": "4e302bed",
"needsInterop": false
}
},

View File

@ -1,29 +1,41 @@
import { defineConfig } from 'vitepress'
import {defineConfig} from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
srcDir: './src',
title: "HN",
description: "A VitePress Site",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Examples', link: '/markdown-examples' }
],
sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
srcDir: './src',
lang: 'zh-CN',
title: "湖湘人文",
description: "湖湘人文",
head: [
[
'script',
{},
`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W3NL9V');`
]
}
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{text: 'Home', link: '/'},
{text: 'Examples', link: '/markdown-examples'}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
}
sidebar: [
{
text: 'Examples',
items: [
{text: 'Markdown Examples', link: '/markdown-examples'},
{text: 'Runtime API Examples', link: '/api-examples'}
]
}
],
socialLinks: [
{icon: 'github', link: 'https://github.com/vuejs/vitepress'}
]
}
})