Skip to content

Commit 4ec6059

Browse files
committed
docs: added Yandex.Metrika for documentation
1 parent 64a80ae commit 4ec6059

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Diff for: docs/.vitepress/theme/index.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
import { yandexMetrika } from '@hywax/vitepress-yandex-metrika'
12
import type { Theme } from 'vitepress'
23
import DefaultTheme from 'vitepress/theme'
34
import './custom.css'
45
import PreviewService from '../components/preview-service.vue'
56

67
export default {
78
extends: DefaultTheme,
8-
enhanceApp({ app }) {
9-
app.component('PreviewService', PreviewService)
9+
enhanceApp(ctx) {
10+
ctx.app.component('PreviewService', PreviewService)
11+
12+
yandexMetrika(ctx, {
13+
enabled: import.meta.env.MODE === 'production',
14+
counter: {
15+
id: 96086220,
16+
initParams: {
17+
trustedDomains: ['mafl.hywax.space'],
18+
},
19+
},
20+
})
1021
},
1122
} satisfies Theme

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@antfu/eslint-config": "^2.6.1",
3030
"@commitlint/cli": "^18.4.3",
3131
"@commitlint/config-conventional": "^18.4.3",
32+
"@hywax/vitepress-yandex-metrika": "^0.2.0",
3233
"@nuxt/devtools": "latest",
3334
"@nuxtjs/color-mode": "^3.3.2",
3435
"@nuxtjs/i18n": "^8.0.0",
@@ -51,4 +52,4 @@
5152
"lint-staged": {
5253
"*.ts": "yarn run lint"
5354
}
54-
}
55+
}

Diff for: yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,11 @@
16011601
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044"
16021602
integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==
16031603

1604+
"@hywax/vitepress-yandex-metrika@^0.2.0":
1605+
version "0.2.0"
1606+
resolved "https://registry.yarnpkg.com/@hywax/vitepress-yandex-metrika/-/vitepress-yandex-metrika-0.2.0.tgz#165f0c1e2ffebbfb2ee952b074db71c4bd59275c"
1607+
integrity sha512-Z8NSsYssCXrELLUB6ZnG4miMUdE+zB/zXLPpH0/FdZyl245T8o3nzmLcQm9e1Aja3lVD10/OAUjd7LCK3NyPWA==
1608+
16041609
"@iconify/collections@^1.0.374":
16051610
version "1.0.375"
16061611
resolved "https://registry.yarnpkg.com/@iconify/collections/-/collections-1.0.375.tgz#e75d4f84ba7c94c7300cf946de2d4372a0b7734c"

0 commit comments

Comments
 (0)