gatsby-uc / gatsby-plugin-pinterest

Gatsby plugin to add Pinterest's add-on scriptđź“Ť

Repository from Github https://github.comgatsby-uc/gatsby-plugin-pinterestRepository from Github https://github.comgatsby-uc/gatsby-plugin-pinterest

Add ability to set data attributes on gatsby-image img tags to support pin type and source settings

robinske opened this issue · comments

According to the docs you can set attributes like data-pin-media or data-pin-url or data-pin-nopin "individually to images on your page."

However gatsby-image doesn't support setting attributes on the img tag so something like this won't work:

<Img
  fluid={image}
  data-pin-url="https://mysite.com/images/dinner-rolls.png" // ignored
/>

This prevents setting attributes when data-pin-hover is set to true or setting data-pin-nopin to ignore images on the page when any image (buttonBookmark) is set.

There's probably a workaround for this but I don't know one off the top of my head. Documenting it here for reference.

This might be solved by the new gatsby image plugin - I'll test this out soon gatsbyjs/gatsby#27950

Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or join us on Discord if you have questions!