Skip to content

Commit

Permalink
Add check for authorTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Aug 13, 2021
1 parent 347f6fe commit a6a9d53
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ function BlogPostItem(props: Props): JSX.Element {
<span itemProp="name">{author}</span>
</Link>
</div>
<small className="avatar__subtitle" itemProp="description">
{authorTitle}
</small>

{authorTitle && (
<small className="avatar__subtitle" itemProp="description">
{authorTitle}
</small>
)}
</div>
)}
</div>
Expand All @@ -134,15 +137,18 @@ function BlogPostItem(props: Props): JSX.Element {
itemScope
itemType="http://schema.org/BlogPosting">
{renderPostHeader()}

{image && (
<meta
itemProp="image"
content={withBaseUrl(image, {absolute: true})}
/>
)}

<div className="markdown" itemProp="articleBody">
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
</div>

{(tags.length > 0 || truncated) && (
<footer
className={clsx('row docusaurus-mt-lg', {
Expand All @@ -157,6 +163,7 @@ function BlogPostItem(props: Props): JSX.Element {
Tags:
</Translate>
</b>

{tags.map(({label, permalink: tagPermalink}) => (
<Link
key={tagPermalink}
Expand Down

0 comments on commit a6a9d53

Please sign in to comment.