mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-26 04:04:27 +02:00
bugfix/#741 - upgrade gatsby-remark-relative-images
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// @flow strict
|
||||
import React from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import { withPrefix } from 'gatsby';
|
||||
import type { Node as ReactNode } from 'react';
|
||||
import { useSiteMetadata } from '../../hooks';
|
||||
import styles from './Layout.module.scss';
|
||||
@@ -21,7 +20,7 @@ const Layout = ({
|
||||
}: Props) => {
|
||||
const { author, url } = useSiteMetadata();
|
||||
const metaImage = socialImage != null ? socialImage : author.photo;
|
||||
const metaImageUrl = url + withPrefix(metaImage);
|
||||
const metaImageUrl = url + metaImage;
|
||||
|
||||
return (
|
||||
<div className={styles.layout}>
|
||||
|
@@ -19,9 +19,10 @@ const PageTemplate = ({ data }: Props) => {
|
||||
const { frontmatter } = data.markdownRemark;
|
||||
const { title: pageTitle, description: pageDescription, socialImage } = frontmatter;
|
||||
const metaDescription = pageDescription !== null ? pageDescription : siteSubtitle;
|
||||
const socialImageUrl = socialImage ? socialImage['publicURL'] : '';
|
||||
|
||||
return (
|
||||
<Layout title={`${pageTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImage} >
|
||||
<Layout title={`${pageTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImageUrl} >
|
||||
<Sidebar />
|
||||
<Page title={pageTitle}>
|
||||
<div dangerouslySetInnerHTML={{ __html: pageBody }} />
|
||||
@@ -39,7 +40,9 @@ export const query = graphql`
|
||||
title
|
||||
date
|
||||
description
|
||||
socialImage
|
||||
socialImage {
|
||||
publicURL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,9 +17,10 @@ const PostTemplate = ({ data }: Props) => {
|
||||
const { frontmatter } = data.markdownRemark;
|
||||
const { title: postTitle, description: postDescription, socialImage } = frontmatter;
|
||||
const metaDescription = postDescription !== null ? postDescription : siteSubtitle;
|
||||
const socialImageUrl = socialImage ? socialImage['publicURL'] : '';
|
||||
|
||||
return (
|
||||
<Layout title={`${postTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImage} >
|
||||
<Layout title={`${postTitle} - ${siteTitle}`} description={metaDescription} socialImage={socialImageUrl} >
|
||||
<Post post={data.markdownRemark} />
|
||||
</Layout>
|
||||
);
|
||||
@@ -39,7 +40,9 @@ export const query = graphql`
|
||||
description
|
||||
tags
|
||||
title
|
||||
socialImage
|
||||
socialImage {
|
||||
publicURL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,8 @@ export type Node = {
|
||||
fields: {
|
||||
slug: string,
|
||||
categorySlug?: string,
|
||||
tagSlugs?: string[]
|
||||
tagSlugs?: string[],
|
||||
socialImageUrl?: string,
|
||||
},
|
||||
frontmatter: {
|
||||
date: string,
|
||||
|
Reference in New Issue
Block a user