mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-25 14:29:36 +01:00
Update page template, post-template
This commit is contained in:
parent
a0d1159934
commit
1c7e4a2cfc
@ -16,10 +16,10 @@ const Layout = ({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
socialImage
|
||||
socialImage = ''
|
||||
}: Props) => {
|
||||
const { author, url } = useSiteMetadata();
|
||||
const metaImage = typeof socialImage !== 'undefined' ? socialImage : author.photo;
|
||||
const metaImage = socialImage || author.photo;
|
||||
const metaImageUrl = url + metaImage;
|
||||
|
||||
return (
|
||||
|
@ -17,9 +17,9 @@ const PageTemplate = ({ data }: Props) => {
|
||||
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
|
||||
const { html: pageBody } = data.markdownRemark;
|
||||
const { frontmatter } = data.markdownRemark;
|
||||
const { title: pageTitle, description: pageDescription, socialImage } = frontmatter;
|
||||
const metaDescription = pageDescription !== null ? pageDescription : siteSubtitle;
|
||||
const socialImageUrl = typeof socialImage !== 'undefined' ? socialImage['publicURL'] : undefined;
|
||||
const { title: pageTitle, description: pageDescription = '', socialImage } = frontmatter;
|
||||
const metaDescription = pageDescription || siteSubtitle;
|
||||
const socialImageUrl = socialImage?.publicURL;
|
||||
|
||||
return (
|
||||
<Layout title={`${pageTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImageUrl} >
|
||||
|
@ -15,9 +15,9 @@ type Props = {
|
||||
const PostTemplate = ({ data }: Props) => {
|
||||
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
|
||||
const { frontmatter } = data.markdownRemark;
|
||||
const { title: postTitle, description: postDescription, socialImage } = frontmatter;
|
||||
const metaDescription = postDescription !== null ? postDescription : siteSubtitle;
|
||||
const socialImageUrl = typeof socialImage !== 'undefined' ? socialImage['publicURL'] : undefined;
|
||||
const { title: postTitle, description: postDescription = '', socialImage } = frontmatter;
|
||||
const metaDescription = postDescription || siteSubtitle;
|
||||
const socialImageUrl = socialImage?.publicURL;
|
||||
|
||||
return (
|
||||
<Layout title={`${postTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImageUrl} >
|
||||
|
Loading…
Reference in New Issue
Block a user