File tree 4 files changed +32
-75
lines changed
4 files changed +32
-75
lines changed Original file line number Diff line number Diff line change 1
1
node_modules /
2
2
_site /
3
3
package-lock.json
4
+ node-supporters.json
5
+ .env
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ const slugify = require ( "slugify" ) ;
2
+
3
+ exports . handler = async ( event , context ) => {
4
+ const supporters = require ( "./node-supporters.json" ) ;
5
+ let isBacker = false ;
6
+ let name = "" ;
7
+
8
+ const { identity, user} = context . clientContext ;
9
+ let email = user . email ;
10
+
11
+ if ( email ) {
12
+ for ( let supporter of supporters . data . collective . members . nodes ) {
13
+ if ( supporter . account . email === email ) {
14
+ isBacker = true ;
15
+ name = supporter . account . name ;
16
+ }
17
+ }
18
+ }
19
+
20
+ return {
21
+ statusCode : 200 ,
22
+ body : `{
23
+ "is-backer": ${ isBacker } ,
24
+ "name": "${ name } ",
25
+ "slug": "${ slugify ( name ) . toLowerCase ( ) } "
26
+ }`
27
+ } ;
28
+ } ;
Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"assets" : " cp node_modules/@11ty/logo/logo.png ." ,
8
8
"build" : " eleventy" ,
9
- "build-production" : " node node-avatars.js && ELEVENTY_PRODUCTION=true eleventy"
9
+ "build-production" : " node node-avatars.js && node node-update-supporters.js && ELEVENTY_PRODUCTION=true eleventy"
10
10
},
11
11
"repository" : {
12
12
"type" : " git" ,
27
27
"avatar-local-cache" : " ^2.0.3" ,
28
28
"chalk" : " ^2.4.2" ,
29
29
"clean-css" : " ^4.2.1" ,
30
+ "dotenv" : " ^8.2.0" ,
30
31
"flat-cache" : " ^2.0.1" ,
31
32
"fs-extra" : " ^8.1.0" ,
32
33
"html-minifier" : " ^3.5.21" ,
You can’t perform that action at this time.
0 commit comments