@@ -6,29 +6,31 @@ const getAuthors = function (node) {
6
6
const author = node . getAttribute ( `author_${ index } ` )
7
7
const email = node . getAttribute ( `email_${ index } ` )
8
8
const bio = node . getAttribute ( `authorbio_${ index } ` )
9
+ const img = node . getAttribute ( `authorimg_${ index } ` )
9
10
let twitter ;
10
11
if ( email && email . startsWith ( "https://twitter.com/" ) ) {
11
12
twitter = email . replace ( "https://twitter.com/" , "" ) ;
12
13
}
13
- result . push ( { name : author , email : email , bio : bio , twitter : twitter } )
14
+ result . push ( { name : author , email : email , bio : bio , img : img , twitter : twitter } )
14
15
}
15
16
} else {
16
17
const author = node . getAttribute ( 'author' )
17
18
const email = node . getAttribute ( 'email' )
18
19
const bio = node . getAttribute ( `authorbio` )
20
+ const img = node . getAttribute ( `authorimg` )
19
21
let twitter ;
20
22
if ( email && email . startsWith ( "https://twitter.com/" ) ) {
21
23
twitter = email . replace ( "https://twitter.com/" , "" ) ;
22
24
}
23
- result . push ( { name : author , email : email , bio : bio , twitter : twitter } )
25
+ result . push ( { name : author , email : email , bio : bio , img : img , twitter : twitter } )
24
26
}
25
27
return result ;
26
28
}
27
29
28
30
const renderAuthors = function ( authors ) {
29
31
return authors . map ( author => {
30
32
return `<div class="author">
31
- <div class="author-avatar"><img src="https://pbs.twimg.com/profile_images/726148230224949249/g2T2qehD_400x400.jpg "/></div>
33
+ <div class="author-avatar"><img src="${ author . img } "/></div>
32
34
<div class="author-name"><a href="${ author . email } ">@${ author . twitter } </a></div>
33
35
<div class="author-bio">${ author . bio } </div>
34
36
</div>
@@ -43,7 +45,7 @@ module.exports = [{
43
45
<html lang="en">
44
46
<head>
45
47
<meta charset="UTF-8">
46
- <link href="./template/assets/style.css" rel="stylesheet">
48
+ <link href="./examples/cheat-sheet/ template/assets/style.css" rel="stylesheet">
47
49
</head>
48
50
<body>
49
51
<header>
0 commit comments