Migrate all images to Gatsby Image

This commit is contained in:
Kevin Kandlbinder 2021-09-24 15:13:11 +02:00
parent 5bbd13e648
commit 4fb0aae042
11 changed files with 100 additions and 41 deletions

View file

@ -6,6 +6,7 @@ import PropTypes from "prop-types";
import * as styles from "./project.module.scss";
import { MDXRenderer } from "gatsby-plugin-mdx";
import { GatsbyImage } from "gatsby-plugin-image";
export const query = graphql`
query GetProject($urlname: String!, $lang: String!, $language: String!) {
@ -21,7 +22,9 @@ export const query = graphql`
website
}
image {
publicURL
childImageSharp {
gatsbyImageData(placeholder: BLURRED, layout: FULL_WIDTH)
}
}
shortDescription
}
@ -65,11 +68,9 @@ const ProjectTemplate = ({ data }) => {
<div style={{ paddingTop: 0 }}>
<div
className={styles.headerBackground}
style={{
backgroundImage:
"url(" + project.image.publicURL + ")",
}}
></div>
>
<GatsbyImage image={project.image.childImageSharp.gatsbyImageData} style={{width: "100%", height: "100%"}} objectFit="cover"></GatsbyImage>
</div>
<header>
<div className={styles.headerInner}>
<h1>