Skip to content

Commit d958a29

Browse files
committed
Add author page
1 parent 37ffc2c commit d958a29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+381
-300
lines changed

pnpm-lock.yaml

Lines changed: 45 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/GuideHeader.astro

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,32 @@ export interface Props {
66
}
77
88
const { 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'>&middot;</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'>&middot;</span>
32+
</>
33+
)
34+
}
3135
<span class='capitalize'>{frontmatter.type} Guide</span>
3236
<span class='mx-1.5'>&middot;</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

Comments
 (0)