mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-01-27 14:01:15 +01:00
Merge pull request #755 from alxshelepenok/bugfix/#741
bugfix/#741 - upgrade gatsby-remark-relative-images
This commit is contained in:
commit
a79523a5da
@ -18,8 +18,8 @@ module.exports = {
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
path: `${__dirname}/content`,
|
||||
name: 'pages'
|
||||
path: `${__dirname}/static`,
|
||||
name: 'assets'
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -32,15 +32,15 @@ module.exports = {
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'css',
|
||||
path: `${__dirname}/static/css`
|
||||
path: `${__dirname}/content`,
|
||||
name: 'pages'
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'assets',
|
||||
path: `${__dirname}/static`
|
||||
name: 'css',
|
||||
path: `${__dirname}/static/css`
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -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';
|
||||
@ -10,7 +9,7 @@ type Props = {
|
||||
children: ReactNode,
|
||||
title: string,
|
||||
description?: string,
|
||||
socialImage? :string
|
||||
socialImage?: string
|
||||
};
|
||||
|
||||
const Layout = ({
|
||||
@ -20,8 +19,8 @@ const Layout = ({
|
||||
socialImage
|
||||
}: Props) => {
|
||||
const { author, url } = useSiteMetadata();
|
||||
const metaImage = socialImage != null ? socialImage : author.photo;
|
||||
const metaImageUrl = url + withPrefix(metaImage);
|
||||
const metaImage = typeof socialImage !== 'undefined' ? socialImage : author.photo;
|
||||
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 = typeof socialImage !== 'undefined' ? socialImage['publicURL'] : undefined;
|
||||
|
||||
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 = typeof socialImage !== 'undefined' ? socialImage['publicURL'] : undefined;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,9 @@ export type Node = {
|
||||
category?: string,
|
||||
tags?: string[],
|
||||
title: string,
|
||||
socialImage?: string
|
||||
socialImage?: {
|
||||
publicURL: string
|
||||
}
|
||||
},
|
||||
html: string,
|
||||
id: string
|
||||
|
Loading…
Reference in New Issue
Block a user