Fix linting errors.

This commit is contained in:
Aleksander Helgaker 2019-08-25 13:50:36 +02:00
parent fabb799f93
commit c94d7409c8
3 changed files with 11 additions and 4 deletions

View File

@ -13,7 +13,12 @@ type Props = {
socialImage? :string
};
const Layout = ({ children, title, description, socialImage }: Props) => {
const Layout = ({
children,
title,
description,
socialImage
}: Props) => {
const { author, url } = useSiteMetadata();
const metaImage = socialImage != null ? socialImage : author.photo;
const metaImageUrl = url + withPrefix(metaImage);
@ -32,7 +37,7 @@ const Layout = ({ children, title, description, socialImage }: Props) => {
</Helmet>
{children}
</div>
)
);
};
export default Layout;

View File

@ -16,7 +16,8 @@ type Props = {
const PageTemplate = ({ data }: Props) => {
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
const { html: pageBody } = data.markdownRemark;
const { title: pageTitle, description: pageDescription, socialImage } = data.markdownRemark.frontmatter;
const frontmatter = data.markdownRemark.frontmatter;
const { title: pageTitle, description: pageDescription, socialImage } = frontmatter;
const metaDescription = pageDescription !== null ? pageDescription : siteSubtitle;
return (

View File

@ -14,7 +14,8 @@ type Props = {
const PostTemplate = ({ data }: Props) => {
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
const { title: postTitle, description: postDescription, socialImage } = data.markdownRemark.frontmatter;
const frontmatter = data.markdownRemark.frontmatter;
const { title: postTitle, description: postDescription, socialImage } = frontmatter;
const metaDescription = postDescription !== null ? postDescription : siteSubtitle;
return (