@@ -6,28 +6,32 @@ export interface Props {
66}
77
88const { guide } = Astro .props ;
9- const { frontmatter } = guide ;
10- const { author } = frontmatter ;
9+ const { frontmatter, author } = guide ;
1110---
1211
13- <div class =' bg-white border-b py-5 sm:py-12' >
12+ <div class =' border-b bg-white py-5 sm:py-12' >
1413 <div class =' container text-left sm:text-center' >
1514 <p
16- class =' text-gray-400 hidden sm:flex items-center justify-start sm:justify-center'
15+ class =' hidden items-center justify-start text-gray-400 sm:flex sm:justify-center'
1716 >
18- <a
19- href ={ author .url }
20- target =' _blank'
21- class =' font-medium hover:text-gray-600 inline-flex items-center hover:underline'
22- >
23- <img
24- alt ={ author .name }
25- src ={ author .imageUrl }
26- class =' w-5 h-5 inline mr-2 rounded-full'
27- />
28- { author .name }
29- </a >
30- <span class =' mx-1.5' >· </span >
17+ {
18+ author ?.frontmatter && (
19+ <>
20+ <a
21+ href = { ` /authors/${author .id } ` }
22+ class = ' inline-flex items-center font-medium hover:text-gray-600 hover:underline'
23+ >
24+ <img
25+ alt = { author .frontmatter .name }
26+ src = { author .frontmatter .imageUrl }
27+ class = ' mr-2 inline h-5 w-5 rounded-full'
28+ />
29+ { author .frontmatter .name }
30+ </a >
31+ <span class = ' mx-1.5' >· </span >
32+ </>
33+ )
34+ }
3135 <span class =' capitalize' >{ frontmatter .type } Guide</span >
3236 <span class =' mx-1.5' >· </span >
3337 <a
@@ -36,10 +40,10 @@ const { author } = frontmatter;
3640 target =' _blank' >Improve this Guide</a
3741 >
3842 </p >
39- <h1 class =' text-2xl sm: text-5xl my-0 sm:my-3.5 font-bold ' >
43+ <h1 class =' my-0 text-2xl font-bold sm:my-3.5 sm:text-5xl ' >
4044 { frontmatter .title }
4145 </h1 >
42- <p class =' hidden sm:block text-gray-400 text-xl ' >
46+ <p class =' hidden text-xl text-gray-400 sm:block ' >
4347 { frontmatter .description }
4448 </p >
4549 </div >
0 commit comments