Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial: add gatsby-image #9374

Closed
shannonbux opened this issue Oct 24, 2018 · 30 comments
Closed

Tutorial: add gatsby-image #9374

shannonbux opened this issue Oct 24, 2018 · 30 comments
Assignees
Labels
good first issue Issue that doesn't require previous experience with Gatsby topic: media Related to gatsby-plugin-image, or general image/media processing topics type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@shannonbux
Copy link
Contributor

shannonbux commented Oct 24, 2018

Summary

We want to create a new tutorial for gatsby-image for intermediate users. This learning resource should show how to create responsive images step-by-step. It would fit best as the first item on the Additional Tutorials page.

Here's some information on creating tutorials: https://www.gatsbyjs.org/contributing/docs-templates/#tutorials

Motivation

Many Gatsby users don't know about gatsby-image and it's one of the most noticeable benefits to Gatsby site visitors.

@jlengstorf continuing the discussion from #9158 (comment)

@shannonbux shannonbux added type: documentation An issue or pull request for improving or updating Gatsby's documentation Hacktoberfest labels Oct 24, 2018
@siddhant1
Copy link
Contributor

On it !

@jlengstorf
Copy link
Contributor

jlengstorf commented Oct 25, 2018

All yours, @siddhant1!

@shannonbux Where do you think this should go? My thought is that it might be its own new section after Part 4 that could be called "Using Images in Gatsby".

Things to cover:

  • Gatsby can use regular images, just like any other web framework (show a small example)
  • Gatsby has tools to automatically optimize images that have been packaged up in gatsby-image
    • lazy loading
    • generation of different sizes
    • optimization to decrease file sizes
    • creation of placeholders
  • Explain why these optimizations are important
  • Show how to install gatsby-image and it's peer dependencies
  • Configure the peer deps to load images from a folder
  • Write a query to load the image data for gatsby-image
  • Discuss the different options (e.g. traced SVG, WebP)
  • Link to using-gatsby-image.gatsbyjs.org

Anything I'm missing here?

@treb0r
Copy link

treb0r commented Oct 31, 2018

It would be great to see some documentation on how to leverage an external service such as imgix with gatsby-image, possibly using react-imgix.

@DSchau DSchau added good first issue Issue that doesn't require previous experience with Gatsby and removed Hacktoberfest labels Nov 6, 2018
@liltechnomancer
Copy link

Can I take this?

@siddhant1
Copy link
Contributor

@Ivrbrtsn sure !

@shannonbux
Copy link
Contributor Author

@lvrbrtsn thanks! See @jlengstorf's comment above. #9374 (comment)

The idea is basically a standalone tutorial on how to put images in a Gatsby site and we can point people to this tutorial after they finish part eight of the current main tutorial. We consider gatsby-image a best practice, but like Jason said, it's important to also teach people the most fundamental and common ways of putting images in Gatsby sites (see the Style Guide for clear reasoning on why we do this).

@harshil1712
Copy link
Contributor

Is anyone working on this? I would like to take this one

@liltechnomancer
Copy link

@harshil1712 Feel free! I have not made much progress and have a lot coming up this next month.

@KyleAMathews
Copy link
Contributor

Updated the description to make clear this issue is for a separate tutorial, not to amend the main tutorial.

@harshil1712
Copy link
Contributor

Just to be on the right track, this file should be in the docs folder, right?

@KyleAMathews
Copy link
Contributor

Yup!

@shannonbux
Copy link
Contributor Author

shannonbux commented Feb 1, 2019 via email

@gatsbot
Copy link

gatsbot bot commented Feb 22, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 22, 2019
@shannonbux
Copy link
Contributor Author

shannonbux commented Feb 26, 2019 via email

@freiksenet freiksenet added not stale and removed not stale stale? Issue that may be closed soon due to the original author not responding any more. labels Feb 26, 2019
@harshithpabbati
Copy link

Was this still there?? Can I work on this ??

@harshil1712
Copy link
Contributor

@harshithpabbati I you want we can work on this together!

@harshithpabbati
Copy link

sure @harshil1712 where were you struck???

@marcysutton
Copy link
Contributor

Hey folks, let us know if you need any help starting the new image tutorial! It would be great to move this forward.

@siddhant1
Copy link
Contributor

I was busy with some work earlier. Will work and close this one in a few days

@polarathene
Copy link
Contributor

There is some changes I contributed to gatsby-image recently but didn't get around to documenting yet. Just saw this issue and it might be relevant to mention them.

It was placeholder base64 related, for being able to set a custom width(instead of the default 20px), which can be useful when 20px doesn't "blur-up" well, or if you want to apply an actual CSS blur filter where a little more detail smooths that out nicely. You can find the related PR here.

The other features were less likely to be useful, just like how the base64 width could be global or per image, you could force a base64 image format or use webp(smaller filesize) which works for Chrome/Firefox while using a bgcolor as a fallback for those not supporting webp.

@ghost
Copy link

ghost commented Apr 9, 2019

@marcysutton I can help with the image tutorial?

@theNaut1lus
Copy link

Hey, Seems like a lot of people have been attempting to work on this, If no one is currently working on the at the moment, I would love to take this up and make this my first contribution here.
@marcysutton @siddhant1 @shannonbux ?

@siddhant1
Copy link
Contributor

Yeah ! Go for it!

@marcysutton
Copy link
Contributor

We would definitely love for someone to take this on! If you're interested in working on it, go for it. Submitting a PR is the best way to move this forward.

The location for this in the docs may move as I'm proposing some changes to the Tutorial section (grouping the main tutorial + advanced tutorials) but that shouldn't impact the content. For ideas on what an image tutorial should cover, you can reference the previous comments from @shannonbux and @jlengstorf:

@polarathene
Copy link
Contributor

polarathene commented Apr 27, 2019

A PR for another feature to gatsby-image is currently in development/review. It adds support for art-direction by supplying an array of fluid/fixed image data, allowing an image to represent multiple variants based on their matching media query condition.

Would be good to include that too, or an update if these docs are finished before the PR is merged.

An example has been linked from the PR author of a recent project they've worked on. It shows how you can make the image responsive to adapt to a suitable portrait variant for mobile vs the landscape variant for desktop/tablet.

@harshil1712
Copy link
Contributor

I found three different articles which cover almost everything. Artilce 1, Article 2, Article 3. Since there's documentation do we need to have a new one? We can give reference to them? If we still need to write a tutorial, will it be fine if I use those?

@marcysutton
Copy link
Contributor

There would likely be some overlap in a gatsby-image tutorial, but it's worth keeping in mind the purpose of tutorials:

Tutorials provide step-by-step guidance for Gatsby workflows, listing all pre-requisites and not assuming knowledge or skipping steps.

A tutorial could guide a user through setting all of this up without the limiting pressure of a reference guide to not be too lengthy. Maybe it would help to think of a tutorial as the written-version of a how-to video. You can certainly start by looking at the content that already exists, but make sure the steps all work in order.

@marcysutton marcysutton added the topic: media Related to gatsby-plugin-image, or general image/media processing topics label Jun 20, 2019
@laurieontech
Copy link
Contributor

I'd be happy to take this on. I'd probably pull a lot from this post if that works?
https://dev.to/laurieontech/rewriting-a-static-website-using-gatsby-and-graphql---part-3-4ho9

@marcysutton
Copy link
Contributor

marcysutton commented Jun 20, 2019

That sounds great, @lstar19! If you can make it a standalone piece, that would be awesome. I would also recommend using the useStaticQuery hook if possible since it's a little bit simpler to read. Thanks again for offering to work on this. I'm going to assign the issue to you, if that's alright!

@marcysutton
Copy link
Contributor

Closed with #15027. Thanks so much for all the input here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby topic: media Related to gatsby-plugin-image, or general image/media processing topics type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

No branches or pull requests