Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/blogs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ const BlogCard = ({ blog }: { blog: (typeof blogs)[number] }) => {
rel="noopener noreferrer"
title={author.name}
>
@{author.id || author.name.toLowerCase().replace(/\s+/g, "")}
{author.name}
</Link>
</React.Fragment>
))}
Expand Down
17 changes: 9 additions & 8 deletions src/theme/BlogPostItem/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export default function BlogPostItemHeaderWrapper(props: Props): JSX.Element {

const blogDate = metadata.date
? new Intl.DateTimeFormat(siteConfig.i18n?.defaultLocale || "en-US", {
year: "numeric",
month: "short",
day: "numeric",
}).format(new Date(metadata.date))
year: "numeric",
month: "short",
day: "numeric",
}).format(new Date(metadata.date))
: undefined;

const tags = (metadata.tags ?? [])
Expand Down Expand Up @@ -121,10 +121,11 @@ export default function BlogPostItemHeaderWrapper(props: Props): JSX.Element {
))}
</div>
{/* Handles after the stack (only authors with a handle) */}
{/* Full name after the stack */}
{authors
.filter((author) => author.handle)
.filter((author) => author.name || author.handle)
.map((author, idx) => (
<React.Fragment key={author.handle}>
<React.Fragment key={author.handle ?? author.name}>
{idx > 0 && (
<span className={styles.authorSep} aria-hidden="true">
,
Expand All @@ -137,10 +138,10 @@ export default function BlogPostItemHeaderWrapper(props: Props): JSX.Element {
target="_blank"
rel="noopener noreferrer"
>
{author.handle}
{author.name || author.handle}
</Link>
) : (
<span className={styles.handle}>{author.handle}</span>
<span className={styles.handle}>{author.name || author.handle}</span>
)}
</React.Fragment>
))}
Expand Down
Loading