diff --git a/gatsby-config.js b/gatsby-config.js index 1fd90ad..1b4546f 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -4,6 +4,7 @@ module.exports = { pathPrefix: '/gatsby-contentful-starter', plugins: [ 'gatsby-transformer-remark', + 'gatsby-transformer-sqip', 'gatsby-plugin-react-helmet', { resolve: 'gatsby-source-contentful', diff --git a/package.json b/package.json index a089a7f..5237bb0 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "contentful-import": "^6.2.0", + "gatsby-image": "^1.0.39", "gatsby-link": "^1.6.34", "gatsby-plugin-react-helmet": "^1.0.8", "gatsby-source-contentful": "^1.3.38", diff --git a/src/components/article-preview.js b/src/components/article-preview.js index 5377d33..64ad473 100644 --- a/src/components/article-preview.js +++ b/src/components/article-preview.js @@ -1,10 +1,18 @@ import React from 'react' import styles from './article-preview.module.css' import Link from 'gatsby-link' +import Img from 'gatsby-image' export default ({ article }) => (
- +

{article.title}

diff --git a/src/components/hero.js b/src/components/hero.js index 75e62d3..4a66c2e 100644 --- a/src/components/hero.js +++ b/src/components/hero.js @@ -1,11 +1,15 @@ import React from 'react' +import Img from "gatsby-image"; import styles from './hero.module.css' export default ({ person }) => (
-
diff --git a/src/pages/index.js b/src/pages/index.js index 72dcf61..b6f0be3 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -46,7 +46,11 @@ export const pageQuery = graphql` heroImage { file { url - } + }, + resolutions { + ...GatsbyContentfulResolutions_withWebp_noBase64 + }, + sqip(numberOfPrimitives: 25, blur: 0) } description { childMarkdownRemark { @@ -69,6 +73,10 @@ export const pageQuery = graphql` url fileName contentType + }, + sqip(numberOfPrimitives: 50, blur: 1), + resolutions { + ...GatsbyContentfulResolutions_withWebp_noBase64 } } }