Recipe site in Gatsby and Firebase-7

Welcome to part-7 of the series. You can find part-6 here.

We will convert our code to use the optimised gatsby-image now. In any site the image loading takes most of the time and it slows down the site. For our site also this is the case and we will fix it by using gatsby-image.

We will be using the gatsby-plugin-remote-images for this. The documentation for the same can be found here.

First we need to install it by the below npm command. So, stop gatsby develop and run the below command in terminal.

npm install --save gatsby-plugin-remote-images

Now, we need to add the plugin in our gatsby-config.js file.

gatsby-config.js

Rest of the chapter is exclusive content and will be in my upcoming book Gatsby Cookbook. You can find more details about it here.

Image for post
Image for post
Gatsby Cookbook

Now, we will receive the big original image, which will change according to screen size.

Image for post
Image for post
Fluid image

This completes part-7 of the series. You can find part-8 here.

You can find the code for the same in this github repo.

Written by

UI Lead- ReactJS, JavaScript and everything in-between.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store