-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-example.json
111 lines (109 loc) · 7.26 KB
/
config-example.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"README": "There are notes in config-example.json and config.php where each of these keys is used. View config-example.json's config.php's comments to see what each value is used for.",
// The name of the directory on thenewsbeat.org. Used to set the dist and relative paths.
// The below line means that the url will end up being https://thenewsbeat.org/2019-reporter-biographies/
"newsbeatDirectoryName": "2019-reporter-biographies",
// The prefix that gets used for generating unique user IDs. You'll need to delete your localStorage to get a new ID generated.
"studyPrefix": "bio_",
// Site name. Ie - The News Beat, The Gazette Star, etc.
"siteName": "The Gazette Star",
// Where the fun happens. Use this area to automatically set all the parameters for the study.
"variations": [
{
"id": "photo",
"constant": "AUTHOR_PHOTO",
"GET": {
"key": "author_photo",
// whitelisted values so not just anything can get used. Only $_GET['author_photo'] = "none" || "true"
"values": {
// if $_GET['author_photo'] = "none" then AUTHOR_PHOTO will be false
"none": false,
// if $_GET['author_photo'] = "true" then AUTHOR_PHOTO will be "../../dist/img/author-image.jpg"
"true": "../../dist/img/author-image.jpg"
// TODO: Make this an array of objects with something like {value: false, match: {type: 'String||Regex||Number', pattern: ''}}
// so we can match more than just explicit strings. OR something that accepts a regex validated value
}
}
},
// Another variation
{
"id": "bio",
"constant": "AUTHOR_BIO",
"GET": {
"key": "author_bio",
"values": {
"none": false,
"personal": "<p>Jim Phelps is a science reporter for The Gazette Star. His coverage of energy and the environment has appeared in the Dallas Morning News, The Atlantic and Newsweek. A Colorado native and life-long Broncos fan, he began his career at the Denver Post, where he was part of a team that won a Pulitzer Prize for their story about the pollution of popular hot springs in Aspen. He graduated with a journalism degree from Vanderbilt University where he served as the editor-in-chief of the student newspaper. His simple pleasures in life include hiking with his wife and two sons and the smell of barbecue on the lakefront after surviving a cold winter.</p>",
"basic": "<p>Jim Phelps is a science reporter for The Gazette Star. His coverage of energy and the environment has appeared in the Dallas Morning News, The Atlantic and Newsweek. He began his career at the Denver Post, where he was part of a team that won a Pulitzer Prize for their story about the pollution of popular hot springs in Aspen. He graduated with a journalism degree from Vanderbilt University and served as editor-in-chief of the student newspaper.</p>"
}
}
}
{
// ID used in the log to reference this parameter
"id": "bio",
// The name of the php CONSTANT that will get generated from this value
"constant": "AUTHOR_BIO",
// key means you'd use ?author_photo to $_GET this value
"GET": "author_bio",
// if this parameter is required or not. Page will die() with message if required is true and the $_GET is not there or if it doesn't match any of the valid items
"required": true,
// allowed vars to match against
"vars": [
{
// reference ID for this var
"id": "none",
// actual key to match against, ie ?author_bio=none
"key": "none",
// value if this key matches. AUTHOR_BIO would be set to false
"value": false
},
{
// reference ID for this var
"id": "personal",
// actual key to match against, ie ?author_bio=personal
"key": "personal",
// value if this key matches. AUTHOR_BIO would be set to the string below
"value": "<p>Jim Phelps is a science reporter for The Gazette Star. His coverage of energy and the environment has appeared in the Dallas Morning News, The Atlantic and Newsweek. A Colorado native and life-long Broncos fan, he began his career at the Denver Post, where he was part of a team that won a Pulitzer Prize for their story about the pollution of popular hot springs in Aspen. He graduated with a journalism degree from Vanderbilt University where he served as the editor-in-chief of the student newspaper. His simple pleasures in life include hiking with his wife and two sons and the smell of barbecue on the lakefront after surviving a cold winter.</p>"
},
{
"id": "basic",
"key": "basic",
"value": "<p>Jim Phelps is a science reporter for The Gazette Star. His coverage of energy and the environment has appeared in the Dallas Morning News, The Atlantic and Newsweek. He began his career at the Denver Post, where he was part of a team that won a Pulitzer Prize for their story about the pollution of popular hot springs in Aspen. He graduated with a journalism degree from Vanderbilt University and served as editor-in-chief of the student newspaper.</p>"
}
]
},
// Another variation with regex
{
"id": "photo_size",
"constant": "AUTHOR_PHOTO_SIZE",
"GET": "photo_size",
"required": false,
"vars": [
{
"id": "small",
"key": "small",
"value": 50
},
{
"id": "px",
// if regex = true, then the key can be a regex pattern to match against. The value will be set if it matches
"key": "/[0-9]+/",
// No "value" here. Will set value as the $_GET['photo_size'] if the regex matches. ID would get set as 'photo_size_'.$_GET['photo_size']
"regex": true
}
]
}
],
// Default article data used across the site, unless overrided by one of the above values.
"article": {
"author": {
"name": "Jim Phelps",
"bio": "<p>Jim Phelps is a science reporter for The Gazette Star. His coverage of energy and the environment has appeared in the Dallas Morning News, The Atlantic and Newsweek. He began his career at the Denver Post, where he was part of a team that won a Pulitzer Prize for their story about the pollution of popular hot springs in Aspen. He graduated with a journalism degree from Vanderbilt University and served as editor-in-chief of the student newspaper.</p>",
"image": {
"src": "../../dist/img/author-image.jpg",
"alt": ""
}
},
"pubdate": "Aug. 6, 2019"
}
}