1
1
import { defineUserConfig } from "vuepress" ;
2
2
import theme from "./theme.js" ;
3
3
import { searchProPlugin } from "vuepress-plugin-search-pro" ;
4
- // import { baiduTongjiPlugin } from "@vuepress-plume/vuepress-plugin-baidu-tongji ";
4
+ import { baiduTongjiPlugin } from "./plugins/baiduTongji.js " ;
5
5
6
6
export default defineUserConfig ( {
7
7
base : process . env . NETLIFY ? "/" : "/wiki/" ,
@@ -22,38 +22,15 @@ export default defineUserConfig({
22
22
// 为分类和标签添加索引
23
23
} ) ,
24
24
25
- /**
26
- * 百度统计
27
- * @see https://www.npmjs.com/package/@vuepress-plume/vuepress-plugin-baidu-tongji
28
- *
29
- */
30
- // baiduTongjiPlugin({
31
- // key: "fc5b45ae006a231c1d5cff4610df7267",
32
- // // key: process.env.CONTEXT === "production" ? "fc5b45ae006a231c1d5cff4610df7267" : "", // 百度统计使用的 key
33
- // }),
34
- ( ) => {
35
- const key =
36
- process . env . CONTEXT === "production"
37
- ? "fc5b45ae006a231c1d5cff4610df7267"
38
- : "" ;
39
- return {
40
- name : "vuepress-plugin-baidu-tongji" ,
41
- extendsPage : ( page ) => {
42
- page . frontmatter . head = page . frontmatter . head || [ ] ;
43
- page . frontmatter . head ?. push ( [
44
- "script" ,
45
- {
46
- type : "text/javascript" ,
47
- } ,
48
- "var _hmt = _hmt || []" ,
49
- ] ) ;
50
- page . frontmatter . head ?. push ( [
51
- "script" ,
52
- { src : `https://hm.baidu.com/hm.js?${ key } ` } ,
53
- ] ) ;
54
- } ,
55
- } ;
56
- } ,
25
+ baiduTongjiPlugin ( {
26
+ keys :
27
+ process . env . CONTEXT !== "production"
28
+ ? [
29
+ "fc5b45ae006a231c1d5cff4610df7267" , // lin
30
+ "fc904ee59939c7c2284063619b0ef533" , // northword
31
+ ]
32
+ : [ ] ,
33
+ } ) ,
57
34
] ,
58
35
59
36
// Enable it with pwa
0 commit comments