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 +2 -0
- package/README.zh-CN.md +41 -0
- package/package.json +2 -2
package/README.md
CHANGED
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 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.
|
|
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.
|
|
31
|
+
"rspress-plugin-devkit": "^0.1.3-beta.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.12.5",
|