docs: add back google analytic

This commit is contained in:
EstrellaXD
2023-11-16 13:22:48 +08:00
parent e35095017e
commit 550bb4e671
4 changed files with 15 additions and 5 deletions

View File

@@ -14,7 +14,6 @@ export default defineConfig({
['meta', {property: 'og:image', content: '/social.png'}],
['meta', {property: 'og:site_name', content: 'AutoBangumi'}],
['meta', {property: 'og:url', content: 'https://www.autobangumi.org'}],
["script", {src: '/_vercel/insights/script.js'}]
],
themeConfig: {

View File

@@ -11,6 +11,7 @@ import mediumZoom from 'medium-zoom'
import Documate from '@documate/vue'
import '@documate/vue/dist/style.css'
import HomePreviewWebUI from './components/HomePreviewWebUI.vue'
import googleAnalytics from 'vitepress-plugin-google-analytics'
import './style.css'
@@ -44,7 +45,9 @@ export default {
() => nextTick(initZoom),
)
},
enhanceApp({app, router, siteData}) {
// ...
}
enhanceApp: (ctx) => {
googleAnalytics({
id: 'G-3Z8W6WMN7J',
})
},
}

View File

@@ -18,6 +18,7 @@
},
"type": "module",
"dependencies": {
"@documate/vue": "^0.3.1"
"@documate/vue": "^0.3.1",
"vitepress-plugin-google-analytics": "^1.0.2"
}
}

7
docs/pnpm-lock.yaml generated
View File

@@ -8,6 +8,9 @@ dependencies:
'@documate/vue':
specifier: ^0.3.1
version: 0.3.1(tailwindcss@3.3.3)(vue@3.3.4)
vitepress-plugin-google-analytics:
specifier: ^1.0.2
version: 1.0.2
devDependencies:
'@documate/documate':
@@ -7460,6 +7463,10 @@ packages:
fsevents: 2.3.2
dev: true
/vitepress-plugin-google-analytics@1.0.2:
resolution: {integrity: sha512-ri8bFUAmt3c/DtPrALauGBIUr2gIJ11c1qNRhwd3/+aiuYZBfQpOosSxcO1AswgwRxP9FwBS6Z7jgdDVyXb2hA==}
dev: false
/vitepress@1.0.0-rc.4(@algolia/client-search@4.18.0)(@types/node@14.18.33)(search-insights@2.6.0):
resolution: {integrity: sha512-JCQ89Bm6ECUTnyzyas3JENo00UDJeK8q1SUQyJYou+4Yz5BKEc/F3O21cu++DnUT2zXc0kvQ2Aj4BZCc/nioXQ==}
hasBin: true