|
13 | 13 | "title": "Analytics provider", |
14 | 14 | "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
15 | 15 | "type": "object", |
16 | | - "properties": { |
17 | | - "provider": { |
18 | | - "title": "Analytics provider", |
19 | | - "anyOf": [ |
20 | | - { |
21 | | - "title": "Google Analytics", |
22 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
23 | | - "enum": [ |
24 | | - "google" |
25 | | - ] |
26 | | - }, |
27 | | - { |
28 | | - "type": "string" |
29 | | - } |
30 | | - ] |
31 | | - }, |
32 | | - "property": { |
33 | | - "anyOf": [ |
34 | | - { |
35 | | - "title": "Google Analytics 4", |
36 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
37 | | - "pattern": "^G-\\w{10}$" |
38 | | - }, |
39 | | - { |
40 | | - "title": "Universal Analytics", |
41 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
42 | | - "pattern": "^UA-\\w{9}-\\w$" |
43 | | - }, |
44 | | - { |
45 | | - "title": "Unknown property", |
46 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
47 | | - "type": "string" |
| 16 | + "allOf": [ |
| 17 | + { |
| 18 | + "if": { |
| 19 | + "properties": { |
| 20 | + "provider": { |
| 21 | + "enum": [ |
| 22 | + "google" |
| 23 | + ] |
| 24 | + } |
48 | 25 | } |
49 | | - ] |
50 | | - }, |
51 | | - "feedback": { |
52 | | - "title": "Was this page helpful?", |
53 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
54 | | - "type": "object", |
55 | | - "properties": { |
56 | | - "title": { |
57 | | - "title": "Feedback widget title", |
58 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
59 | | - "type": "string", |
60 | | - "default": "Was this page helpful?" |
61 | | - }, |
62 | | - "ratings": { |
63 | | - "title": "Feedback ratings", |
64 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
65 | | - "type": "array", |
66 | | - "items": { |
67 | | - "title": "Feedback rating", |
68 | | - "type": "object", |
69 | | - "properties": { |
70 | | - "icon": { |
71 | | - "$ref": "#/$defs/icon" |
72 | | - }, |
73 | | - "name": { |
74 | | - "title": "Feedback rating name", |
75 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.name", |
76 | | - "type": "string" |
77 | | - }, |
78 | | - "data": { |
79 | | - "title": "Feedback rating data", |
80 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.data", |
81 | | - "type": "number" |
| 26 | + }, |
| 27 | + "then": { |
| 28 | + "properties": { |
| 29 | + "provider": { |
| 30 | + "title": "Google Analytics", |
| 31 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
| 32 | + "enum": [ |
| 33 | + "google" |
| 34 | + ] |
| 35 | + }, |
| 36 | + "property": { |
| 37 | + "anyOf": [ |
| 38 | + { |
| 39 | + "title": "Google Analytics 4", |
| 40 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
| 41 | + "pattern": "^G-\\w{10}$" |
82 | 42 | }, |
83 | | - "note": { |
84 | | - "title": "Feedback rating data", |
85 | | - "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.note", |
| 43 | + { |
| 44 | + "title": "Unknown property", |
| 45 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#google-analytics", |
86 | 46 | "type": "string" |
87 | 47 | } |
88 | | - }, |
89 | | - "additionalProperties": false, |
90 | | - "required": [ |
91 | | - "icon", |
92 | | - "name", |
93 | | - "data", |
94 | | - "note" |
95 | 48 | ] |
| 49 | + }, |
| 50 | + "feedback": { |
| 51 | + "$ref": "#/$defs/feedback" |
| 52 | + } |
| 53 | + }, |
| 54 | + "required": [ |
| 55 | + "provider", |
| 56 | + "property" |
| 57 | + ], |
| 58 | + "additionalProperties": false |
| 59 | + } |
| 60 | + }, |
| 61 | + { |
| 62 | + "if": { |
| 63 | + "properties": { |
| 64 | + "provider": { |
| 65 | + "type": "string" |
96 | 66 | } |
97 | 67 | } |
98 | 68 | }, |
99 | | - "additionalProperties": false, |
100 | | - "required": [ |
101 | | - "title" |
102 | | - ] |
| 69 | + "then": { |
| 70 | + "properties": { |
| 71 | + "provider": { |
| 72 | + "title": "Custom analytics provider", |
| 73 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#custom-site-analytics", |
| 74 | + "type": "string" |
| 75 | + }, |
| 76 | + "feedback": { |
| 77 | + "$ref": "#/$defs/feedback" |
| 78 | + } |
| 79 | + }, |
| 80 | + "required": [ |
| 81 | + "provider" |
| 82 | + ] |
| 83 | + } |
103 | 84 | } |
104 | | - }, |
105 | | - "additionalProperties": false, |
106 | | - "required": [ |
107 | | - "provider", |
108 | | - "property" |
109 | 85 | ], |
110 | 86 | "defaultSnippets": [ |
111 | 87 | { |
|
406 | 382 | "type": "string" |
407 | 383 | } |
408 | 384 | ] |
| 385 | + }, |
| 386 | + "feedback": { |
| 387 | + "title": "Was this page helpful?", |
| 388 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
| 389 | + "type": "object", |
| 390 | + "properties": { |
| 391 | + "title": { |
| 392 | + "title": "Feedback widget title", |
| 393 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
| 394 | + "type": "string", |
| 395 | + "default": "Was this page helpful?" |
| 396 | + }, |
| 397 | + "ratings": { |
| 398 | + "title": "Feedback ratings", |
| 399 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#was-this-page-helpful", |
| 400 | + "type": "array", |
| 401 | + "items": { |
| 402 | + "title": "Feedback rating", |
| 403 | + "type": "object", |
| 404 | + "properties": { |
| 405 | + "icon": { |
| 406 | + "$ref": "#/$defs/icon" |
| 407 | + }, |
| 408 | + "name": { |
| 409 | + "title": "Feedback rating name", |
| 410 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.name", |
| 411 | + "type": "string" |
| 412 | + }, |
| 413 | + "data": { |
| 414 | + "title": "Feedback rating data", |
| 415 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.data", |
| 416 | + "type": "number" |
| 417 | + }, |
| 418 | + "note": { |
| 419 | + "title": "Feedback rating data", |
| 420 | + "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/#+analytics.feedback.ratings.note", |
| 421 | + "type": "string" |
| 422 | + } |
| 423 | + }, |
| 424 | + "additionalProperties": false, |
| 425 | + "required": [ |
| 426 | + "icon", |
| 427 | + "name", |
| 428 | + "data", |
| 429 | + "note" |
| 430 | + ] |
| 431 | + } |
| 432 | + } |
| 433 | + }, |
| 434 | + "additionalProperties": false, |
| 435 | + "required": [ |
| 436 | + "title" |
| 437 | + ] |
409 | 438 | } |
410 | 439 | }, |
411 | 440 | "defaultSnippets": [ |
|
414 | 443 | "body": { |
415 | 444 | "analytics": { |
416 | 445 | "provider": "${1:google}", |
417 | | - "property": "${2:UA-XXXXXXXX-X}" |
| 446 | + "property": "${2:G-XXXXXXXXXX}" |
418 | 447 | } |
419 | 448 | } |
420 | 449 | } |
|
0 commit comments