-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(docs): improve image docs from workflow evaluation #14697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great!
docs/docs/gatsby-image-api.md
Outdated
|
||
## Setting up Gatsby Image | ||
|
||
To install Gatsby Image, install the `gatsby-image` package along with necessary plugins `gatsby-transformer-sharp` and `gatsby-plugin-sharp`. Reference the packages in your Gatsby config file. You can also provide additional options to [`gatsby-plugin-sharp`](/packages/gatsby-plugin-sharp/) in your config file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include a copy-pasteable block here for convenience?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debated on that. It's included so many places, I linked to the docs instead. But we could add it if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up adding it in! Thanks for the nudge.
docs/docs/gatsby-image-api.md
Outdated
} | ||
``` | ||
|
||
Read more in the [gatsby-plugin-sharp](/packages/gatsby-plugin-sharp/?=#fluid) README. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read more in the [gatsby-plugin-sharp](/packages/gatsby-plugin-sharp/?=#fluid) README. | |
Read more in the [gatsby-plugin-sharp](/packages/gatsby-plugin-sharp/#fluid) README. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anchors don't seem to be working, FYI. 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't seem to work for me no matter what the URL is...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they do work for me in their existing form, at least locally when I click them. They don't work when deep-linked
docs/docs/gatsby-image-api.md
Outdated
In addition to `gatsby-plugin-sharp` settings in `gatsby-config.js`, there are additional query options that apply to both _fluid_ and _fixed_ images: | ||
|
||
- `grayscale` (bool, default: false) | ||
- `duotone` (bool|obj, default: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be too much, but a before/after of grayscale
and duotone
would be dope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh maybe @gillkyle could help me with that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what I added (note: these images will only be displayed like this if you've upgraded gatsby-remark-images
like this PR #14716):
Just pushed right to this branch, feel free to edit it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're amazing, thanks @gillkyle !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be really helpful with the additions of the API section as well as a specific page on GIFs 👏
Left some really minor comments.
|
||
Additionally, plugins supporting `gatsby-image` currently include [gatsby-source-contentful](/packages/gatsby-source-contentful/), [gatsby-source-datocms](https://github.com/datocms/gatsby-source-datocms) and [gatsby-source-sanity](https://github.com/sanity-io/gatsby-source-sanity). See the [gatsby-image](/packages/gatsby-image/#fragments) README for more details. | ||
|
||
## Gatsby-image props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this info (and maybe some other stuff in this API section are really closely related to what's in the gatsby-image
README which this page links to, would it make sense to have the README link back to this page too?
And maybe this table of props is something that could be an MDX component at some point so the two don't diverge (though I'm guessing they don't get updated frequently if at all).
Co-Authored-By: gillkyle <[email protected]>
Co-Authored-By: gillkyle <[email protected]>
Woooo! |
* add API doc for Gatsby Image, improve API titles * improve content in image docs * add doc on working with GIFs * chore: format * update GIFs page with an animated GIF, for reasons * a few copy tweaks to Gatsby Image API doc * code block tweaks and moving links * add markdown + a11y note to GIFs page * pr feedback from Jason * change warning to a note per feedback * Update docs/docs/using-gatsby-image.md Co-Authored-By: gillkyle <[email protected]> * Update docs/docs/gatsby-image.md Co-Authored-By: gillkyle <[email protected]> * chore: add example images demonstrating duotone and grayscale in image api * add install code blocks for copy/paste
Description
As part of #14529, this PR introduces more documentation for images in Gatsby. Specifically:
Things still to do:
gatsby-image
#9374)I decided not to add the gatsby-image props, fragments and API info in Reference Guides because that content went into the new API doc instead. Those docs are more conceptual and do include some examples, but they link off to the API doc instead of including all the parameters/methods/etc. It seemed like overkill and potentially confusing to include those in multiple places.
I'm super open to improvements, as this is the first go at the API doc! Let me know if there's anything you feel could be improved or simplified if it's too long. I tried to bring the major components all together into one place but it's a lot of stuff, so I subjectively included what I thought was important to know.