Browse Source

Handle case when author does not exist

According to the Edge type in allMarkdownRemarkData, the author in
frontmatter could be undefined.

related to #24
main
tricinel 7 years ago
parent
commit
990a13e2af
  1. 4
      src/pages/blog/all.html.js

4
src/pages/blog/all.html.js

@ -76,6 +76,7 @@ const AllBlogPosts = ({data}: Props) => (
</Link>
</h2>
<MetaTitle>{node.fields.date}</MetaTitle>
{node.frontmatter.author ? (
<div
css={{
color: colors.subtle,
@ -88,6 +89,9 @@ const AllBlogPosts = ({data}: Props) => (
</span>
))}
</div>
) : (
<div />
)}
</li>
))}
</ul>

Loading…
Cancel
Save