Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca42a7a

Browse files
committed
docs: add swetrix analytics
1 parent 9232762 commit ca42a7a

File tree

3 files changed

+112
-63
lines changed

3 files changed

+112
-63
lines changed

‎docs/.vitepress/theme/index.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Theme } from 'vitepress'
22
import DefaultTheme from 'vitepress/theme'
33
import { inBrowser } from 'vitepress'
4+
import * as Swetrix from 'swetrix'
45
import VuetifyLayout from './VuetifyLayout.vue'
56

67
import './styles/main.css'
@@ -14,4 +15,11 @@ if (inBrowser)
1415
export default {
1516
extends: DefaultTheme,
1617
Layout: VuetifyLayout,
18+
enhanceApp() {
19+
Swetrix.init('KMc9xOD28UCn', {
20+
apiURL: 'https://swetrix-api.vuetifyjs.com/log',
21+
})
22+
Swetrix.trackViews()
23+
Swetrix.trackErrors()
24+
},
1725
} satisfies Theme

‎docs/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"generate-pwa-icons": "pwa-assets-generator"
1212
},
1313
"dependencies": {
14+
"swetrix": "^3.4.1",
1415
"vue": "^3.4.21"
1516
},
1617
"devDependencies": {

0 commit comments

Comments
 (0)