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

View File

@ -1,29 +1,41 @@
import { defineConfig } from 'vitepress' import {defineConfig} from 'vitepress'
// https://vitepress.dev/reference/site-config // https://vitepress.dev/reference/site-config
export default defineConfig({ export default defineConfig({
srcDir: './src', srcDir: './src',
title: "HN", lang: 'zh-CN',
description: "A VitePress Site", title: "湖湘人文",
themeConfig: { description: "湖湘人文",
// https://vitepress.dev/reference/default-theme-config head: [
nav: [ [
{ text: 'Home', link: '/' }, 'script',
{ text: 'Examples', link: '/markdown-examples' } {},
], `(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],
sidebar: [ 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);
text: 'Examples', })(window,document,'script','dataLayer','GTM-W3NL9V');`
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
] ]
}
], ],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{text: 'Home', link: '/'},
{text: 'Examples', link: '/markdown-examples'}
],
socialLinks: [ sidebar: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' } {
] 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'}
]
}
}) })