File tree 1 file changed +19
-13
lines changed
1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change 42
42
<a href ="/posts/ {post .slug }" >
43
43
<div class =" flex flex-col overflow-hidden rounded-lg shadow-lg" >
44
44
<div class =" flex-shrink-0" >
45
+ {#if post .coverImage }
45
46
<img
46
47
class =" h-48 w-full object-cover"
47
48
src ={urlForImage (post .coverImage ).crop (" focalpoint" ).width (826 ).height (384 ).url ()}
48
49
alt =" "
49
50
/>
51
+ {/if }
50
52
</div >
51
53
<div class =" flex flex-1 flex-col justify-between bg-white p-6" >
52
54
<div class =" flex-1" >
63
65
</div >
64
66
<div class =" mt-6 flex items-center" >
65
67
<div class =" flex-shrink-0" >
66
- <span class =" sr-only" >Roel Aufderehar</span >
67
- <img
68
- class =" h-10 w-10 rounded-full"
69
- src ={urlForImage (post .author .picture ).crop (" focalpoint" ).width (256 ).height (256 ).url ()}
70
- alt =" "
71
- />
68
+ <span class =" sr-only" >Author Image</span >
69
+ {#if post .author }
70
+ <img
71
+ class =" h-10 w-10 rounded-full"
72
+ src ={urlForImage (post .author .picture ).crop (" focalpoint" ).width (256 ).height (256 ).url ()}
73
+ alt =" "
74
+ />
75
+ {/if }
72
76
</div >
73
- <div class =" ml-3" >
74
- <p class ="text-sm font-medium text-gray-900" >{post .author .name }</p >
75
- <div class =" flex space-x-1 text-sm text-gray-500" >
76
- <time datetime =" 2020-03-16" >
77
- {new Date (post .date ).toLocaleDateString ()}
78
- </time >
77
+ {#if post .author }
78
+ <div class =" ml-3" >
79
+ <p class ="text-sm font-medium text-gray-900" >{post .author .name }</p >
80
+ <div class =" flex space-x-1 text-sm text-gray-500" >
81
+ <time datetime =" 2020-03-16" >
82
+ {new Date (post .date ).toLocaleDateString ()}
83
+ </time >
84
+ </div >
79
85
</div >
80
- </ div >
86
+ { /if }
81
87
</div >
82
88
</div >
83
89
</div >
You can’t perform that action at this time.
0 commit comments