rspress-plugin-google-analytics 0.1.1 → 0.1.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # rspress-plugin-google-analytics ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-google-analytics)
2
2
 
3
+ [简体中文](./README.zh-CN.md)
4
+
3
5
  Rspress plugin for [Google Analytics](https://analytics.google.com/) integration.
4
6
 
5
7
  ## Usage
@@ -0,0 +1,41 @@
1
+ # rspress-plugin-google-analytics ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-google-analytics)
2
+
3
+ 为 Rspress 集成 [Google Analytics](https://analytics.google.com/)。
4
+
5
+ ## 使用
6
+
7
+ ```bash
8
+ npm i rspress-plugin-google-analytics
9
+ pnpm add rspress-plugin-google-analytics
10
+ ```
11
+
12
+ ```ts
13
+ import * as path from 'path';
14
+ import { defineConfig } from 'rspress/config';
15
+ import ga from 'rspress-plugin-google-analytics';
16
+
17
+ export default defineConfig({
18
+ root: path.join(__dirname, 'docs'),
19
+ plugins: [
20
+ ga({
21
+ id: 'UA-123456789-0',
22
+ }),
23
+ ],
24
+ });
25
+ ```
26
+
27
+ ## 配置
28
+
29
+ ### id
30
+
31
+ Google Analytics 的跟踪 ID。
32
+
33
+ - Type: `string | string[]`
34
+ - Required
35
+
36
+ ### anonymizeIp
37
+
38
+ 启用 [匿名 IP 地址](https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization)。
39
+
40
+ - Type: `boolean`
41
+ - Default: `false`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress-plugin-google-analytics",
3
- "version": "0.1.1",
3
+ "version": "0.1.3-beta.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@rspress/shared": "^1.17.1",
31
- "rspress-plugin-devkit": "^0.1.1"
31
+ "rspress-plugin-devkit": "^0.1.3-beta.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.12.5",