diff --git a/src/theme/BlogPostItem/Footer/index.tsx b/src/theme/BlogPostItem/Footer/index.tsx index 5c0f04ca..053076a6 100644 --- a/src/theme/BlogPostItem/Footer/index.tsx +++ b/src/theme/BlogPostItem/Footer/index.tsx @@ -89,9 +89,7 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element { month: "short", day: "numeric", }).format(new Date(metadata.date)); - const metaItems = [authorHandle, blogDate, readTimeText] - .filter(Boolean) - .join(META_SEPARATOR); + const metaDateAndTime = [blogDate, readTimeText].filter(Boolean).join(META_SEPARATOR); const showAuthorCard = Boolean(isBlogPostPage && primaryAuthor && authorName); @@ -111,7 +109,28 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element {
- {authorAvatar ? ( + {githubUrl ? ( + + {authorAvatar ? ( + {`${authorName} + ) : ( + + )} + + ) : authorAvatar ? (
-

{authorName}

+ {githubUrl ? ( + + {authorName} + + ) : ( +

{authorName}

+ )} Author
- {metaItems ?

{metaItems}

: null} + {(authorHandle || metaDateAndTime) ? ( +

+ {authorHandle && ( + githubUrl ? ( + + {authorHandle} + + ) : ( + authorHandle + ) + )} + {authorHandle && metaDateAndTime ? META_SEPARATOR : null} + {metaDateAndTime} +

+ ) : null} {authorSummary ? (

{authorSummary}

) : null} diff --git a/src/theme/BlogPostItem/Footer/styles.module.css b/src/theme/BlogPostItem/Footer/styles.module.css index 1643ae81..7fe3ca4b 100644 --- a/src/theme/BlogPostItem/Footer/styles.module.css +++ b/src/theme/BlogPostItem/Footer/styles.module.css @@ -34,6 +34,16 @@ justify-content: center; } +.authorAvatarLink { + display: block; + line-height: 0; + border-radius: 50%; +} + +.authorAvatarLink:hover { + opacity: 0.85; +} + .authorAvatar, .authorAvatarFallback { width: 64px; @@ -64,6 +74,21 @@ font-size: 1.75rem; font-weight: 800; line-height: 1.2; + color: var(--ifm-font-color-base); + text-decoration: none; +} + +.authorName:hover { + text-decoration: underline; +} + +.authorHandleLink { + color: inherit; + text-decoration: none; +} + +.authorHandleLink:hover { + text-decoration: underline; } .authorNameRow {