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

docs(gatsby-plugin-image): Update readme #29076

Merged
merged 4 commits into from
Jan 26, 2021
Merged

docs(gatsby-plugin-image): Update readme #29076

merged 4 commits into from
Jan 26, 2021

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jan 18, 2021

This is a new readme for gatsby-plugin-image, based on the new docs and API. It should be merged after the reference guide (#28935) and the migration guide (#29036) because it includes links to them.

rendered version

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 18, 2021
@LekoArts LekoArts added 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 and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 19, 2021
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Left some edits, but nothing major.

packages/gatsby-plugin-image/README.md Outdated Show resolved Hide resolved

1. Install `gatsby-plugin-image` and `gatsby-plugin-sharp`:
1. Install `gatsby-plugin-image`, `gatsby-source-filesystem` and `gatsby-plugin-sharp`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a switch case where source-filesystem is for static and transformer is for gatsbyImage? You won't always need it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not always it's true, but it's not as simple as 1:1 though

packages/gatsby-plugin-image/README.md Outdated Show resolved Hide resolved
packages/gatsby-plugin-image/README.md Outdated Show resolved Hide resolved
packages/gatsby-plugin-image/README.md Outdated Show resolved Hide resolved

2. **Configure your image.**

You configure the image by passing arguments to the `gatsbyImageData` resolver. You can change the size and layout, as well as settings such as the type of placeholder used when lazy loading. There are also advanced image processing options available. You can find the full list of options in the API docs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the API docs again in case people are jumping to this section?

avatar {
childImageSharp {
gatsbyImageData(
width: 200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
width: 200
width: 200,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commas are optional when it's multiline. Prettier removes them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I legit just realized this when I was doing it on my site. Strange.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accepted all of the suggesitons, but then started to edit locally before committing then realised prettier just removed them again!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I think just leave them out. Hopefully people won't have copy/paste issues. But if it's valid syntax they shouldn't.

childImageSharp {
gatsbyImageData(
width: 200
placeholder: BLURRED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
placeholder: BLURRED
placeholder: BLURRED,

avatar {
childImageSharp {
gatsbyImageData(
width: 200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
width: 200
width: 200,

childImageSharp {
gatsbyImageData(
width: 200
placeholder: BLURRED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
placeholder: BLURRED
placeholder: BLURRED,

laurieontech
laurieontech previously approved these changes Jan 26, 2021
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Can always make adjustments later.

packages/gatsby-plugin-image/README.md Outdated Show resolved Hide resolved
@ascorbic ascorbic added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 26, 2021
@ascorbic ascorbic requested a review from LekoArts January 26, 2021 16:07
@ascorbic ascorbic merged commit 5cd0acb into master Jan 26, 2021
@ascorbic ascorbic deleted the docs/images-readme branch January 26, 2021 16:28
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
* docs(gatsby-plugin-image): Update readme

* Update

* Apply suggestions from code review

Co-authored-by: LB <[email protected]>

* Changes from review

Co-authored-by: LB <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes 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

Successfully merging this pull request may close these issues.

3 participants