10
10
<BVDContributorsContainer
11
11
type =" platinum-sponsors"
12
12
:contributors =" platinumSponsors"
13
+ :nofollow =" false"
13
14
></BVDContributorsContainer >
14
15
</template >
15
16
19
20
<BVDContributorsContainer
20
21
type =" gold-sponsors"
21
22
:contributors =" goldSponsors"
23
+ :nofollow =" false"
22
24
></BVDContributorsContainer >
23
25
</template >
24
26
28
30
<BVDContributorsContainer
29
31
type =" silver-sponsors"
30
32
:contributors =" silverSponsors"
33
+ :nofollow =" false"
31
34
></BVDContributorsContainer >
32
35
</template >
33
36
37
40
<BVDContributorsContainer
38
41
type =" bronze-sponsors"
39
42
:contributors =" bronzeSponsors"
43
+ :nofollow =" false"
40
44
></BVDContributorsContainer >
41
45
</template >
42
46
</template >
71
75
height : 55px ;
72
76
}
73
77
78
+ a :hover .contributor-thumbnail {
79
+ background-color : #6c757d40 ;
80
+ }
81
+
82
+ .contributor-name {
83
+ font-size : 80% ;
84
+ font-weight : 400 ;
85
+ }
86
+
74
87
.backers & {
75
88
width : 80px ;
76
89
77
90
.contributor-thumbnail {
78
91
height : 80px ;
79
92
}
93
+
94
+ .contributor-name {
95
+ font-size : 70% ;
96
+ }
80
97
}
81
98
82
99
.bronze-sponsors & {
93
110
.contributor-thumbnail {
94
111
height : 100px ;
95
112
}
113
+
114
+ .contributor-name {
115
+ font-size : 90% ;
116
+ font-weight : bold ;
117
+ }
96
118
}
97
119
98
120
.gold-sponsors & {
101
123
.contributor-thumbnail {
102
124
height : 120px ;
103
125
}
126
+
127
+ .contributor-name {
128
+ font-size : 90% ;
129
+ font-weight : bold ;
130
+ }
104
131
}
105
132
106
133
.platinum-sponsors & {
109
136
.contributor-thumbnail {
110
137
height : 140px ;
111
138
}
139
+
140
+ .contributor-name {
141
+ font-size : 100% ;
142
+ font-weight : bold ;
143
+ }
112
144
}
113
145
}
114
146
</style >
117
149
import BVDContributorsContainer from ' ~/components/contributors-container'
118
150
119
151
const OC_BASE_URL = ' https://rest.opencollective.com/v2/bootstrap-vue/orders/'
120
- const OC_DEFAULT_PARAMS = { status: ' active' , tierSlug: null , limit: 100 }
152
+ const OC_DEFAULT_PARAMS = { status: ' active' , tierSlug: null , limit: 200 }
153
+
154
+ const MAX_BACKERS = 32
155
+ const MAX_DONORS = 64
121
156
122
- const MAX_BACKERS = 16
123
- const MAX_DONORS = 32
157
+ // This value needs to be less than or equal to our bronze tier amount
158
+ // We may want to set two thresholds: a single donation amount and
159
+ // a total dontation amount. This determine if we link to the donors
160
+ // website or not. Used to help prevent abuse of opencollective via
161
+ // small dontations to gain cheep backlinks for Google page rank
162
+ const LINK_AMT_THRESHOLD = 20
124
163
125
164
export default {
126
165
name: ' BVDContributors' ,
@@ -179,19 +218,35 @@ export default {
179
218
},
180
219
processOcNodes (nodes = []) {
181
220
return nodes .map (entry => {
221
+ // For recurring donations, this is the total amount donated
222
+ // For users that donate multiple times, this will be the total of all one time donations
223
+ const totalAmount = entry .totalDonations .value
224
+ const amount = entry .amount .value
225
+ // Fallback URL
226
+ const slug = entry .fromAccount .slug
227
+ const fallbackUrl = slug ? ` https://opencollective.com/${ slug} ` : null
228
+ // Return the normalized result
182
229
return {
183
- slug: entry . fromAccount . slug ,
230
+ slug: slug,
184
231
name: entry .fromAccount .name ,
232
+ // type: 'ORGANIZATION', 'INDIVIDUAL'
185
233
type: entry .fromAccount .type ,
186
234
imageUrl: entry .fromAccount .imageUrl ,
187
- website: entry .fromAccount .website ,
235
+ // We only link their website when the total amount is at or above a certain
236
+ // threshold to prevent some questionable websites from abusing opencollective
237
+ // as a means to improve thier Google page ranking via backlinks
238
+ website:
239
+ Math .max (amount || 0 , totalAmount || 0 ) < LINK_AMT_THRESHOLD
240
+ ? null
241
+ : entry .fromAccount .website || fallbackUrl,
242
+ // status: 'ACTIVE' = typically recurring, 'PAID' = typially one time donation
188
243
status: entry .status ,
189
244
// For recurring donations, this is the installment amount
190
245
// For one time donations, this is the donation amount (most recent)
191
- amount: entry . amount . value ,
246
+ amount: amount,
192
247
// For recurring donations, this is the total amount donated
193
248
// For users that donate multiple times, this will be the total of all one time donations
194
- totalAmount: entry . totalDonations . value ,
249
+ totalAmount: totalAmount ,
195
250
// For recurring donations, this is how often the donation is received
196
251
frequency: entry .frequency ,
197
252
// We now have sponsor tiers, but some appear as
@@ -228,15 +283,20 @@ export default {
228
283
processBackers (backers = []) {
229
284
// Backers are provided in reverse chronological order
230
285
// so we sort by larger amount first, then by date
231
- // Limit to top 16 backers
232
- this .backers = backers .sort (this .sortCompare ).slice (0 , MAX_BACKERS )
286
+ // Some backers have the tier level as `null`, which started
287
+ // backing before we started the tier levels
288
+ // Limit to top N backers
289
+ this .backers = backers
290
+ .filter (b => b .tier === null || b .tier === ' backers' )
291
+ .sort (this .sortCompare )
292
+ .slice (0 , MAX_BACKERS )
233
293
},
234
294
processDonors (donors = []) {
235
295
// Donors are provided in reverse chronological order,
236
296
// but donors can be listed more than once (for each individual donation),
237
- // although the `totalDonations` is the same on each entry
238
- // We sort by larger amount first, then by date
239
- // Limit to top 32 most recent donors
297
+ // although the `totalDonations` is the same on each entry. We filter out
298
+ // duplicate donors by slug, then sort by larger amount first, then by date
299
+ // Limit to top N most recent donors
240
300
this .donors = donors
241
301
.reduce ((results , donor ) => {
242
302
if (results .map (d => d .slug ).indexOf (donor .slug ) === - 1 ) {
@@ -260,7 +320,8 @@ export default {
260
320
// Bronze sponors are people/organizations with a recurring (active) bronze sponorship
261
321
this .makeOcRequest (this .processBronzeSponsors .bind (this ), { tierSlug: ' bronze-sponsors' })
262
322
// Backers are people/organizations with recurring (active) donations
263
- this .makeOcRequest (this .processBackers .bind (this ), { tierSlug: ' backers' })
323
+ // Some backers are not tagged as "backers" slug (`null` slug), but have status "active"
324
+ this .makeOcRequest (this .processBackers .bind (this ), { status: ' active' })
264
325
// Donors are people/organizations with one-time (paid) donations
265
326
this .makeOcRequest (this .processDonors .bind (this ), { status: ' paid' })
266
327
}
0 commit comments