Skip to content

Commit

Permalink
docs: added Yandex.Metrika for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Jan 10, 2024
1 parent 64a80ae commit 4ec6059
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { yandexMetrika } from '@hywax/vitepress-yandex-metrika'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './custom.css'
import PreviewService from '../components/preview-service.vue'

export default {
extends: DefaultTheme,
enhanceApp({ app }) {
app.component('PreviewService', PreviewService)
enhanceApp(ctx) {
ctx.app.component('PreviewService', PreviewService)

yandexMetrika(ctx, {
enabled: import.meta.env.MODE === 'production',
counter: {
id: 96086220,
initParams: {
trustedDomains: ['mafl.hywax.space'],
},
},
})
},
} satisfies Theme
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@antfu/eslint-config": "^2.6.1",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@hywax/vitepress-yandex-metrika": "^0.2.0",
"@nuxt/devtools": "latest",
"@nuxtjs/color-mode": "^3.3.2",
"@nuxtjs/i18n": "^8.0.0",
Expand All @@ -51,4 +52,4 @@
"lint-staged": {
"*.ts": "yarn run lint"
}
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,11 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044"
integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==

"@hywax/vitepress-yandex-metrika@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@hywax/vitepress-yandex-metrika/-/vitepress-yandex-metrika-0.2.0.tgz#165f0c1e2ffebbfb2ee952b074db71c4bd59275c"
integrity sha512-Z8NSsYssCXrELLUB6ZnG4miMUdE+zB/zXLPpH0/FdZyl245T8o3nzmLcQm9e1Aja3lVD10/OAUjd7LCK3NyPWA==

"@iconify/collections@^1.0.374":
version "1.0.375"
resolved "https://registry.yarnpkg.com/@iconify/collections/-/collections-1.0.375.tgz#e75d4f84ba7c94c7300cf946de2d4372a0b7734c"
Expand Down

0 comments on commit 4ec6059

Please sign in to comment.