-
Notifications
You must be signed in to change notification settings - Fork 6
Manually trigger script for non-hover use cases #29
Conversation
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
=======================================
Coverage 60.00% 60.00%
=======================================
Files 1 1
Lines 10 10
Branches 3 3
=======================================
Hits 6 6
Misses 2 2
Partials 2 2 Continue to review full report at Codecov.
|
Looks good @robinske! I think we can just go for this, since as you mentioned, this is what the Twitter plugin does. One question: could you add a bit about this on the README under "Usage"? I'm thinking we could have a small section explaining how to configure the plugin and use it when we want to only add the pin button to individual images. Happy to do it as well if you'd like me to. |
Happy to - I think this ties into my comment on #1 about the attributes so some clarification will be useful. I'll get to that sometime this week probably. Thanks for your snappy responses @robinmetral ! |
Updated the docs! |
Note: not all attributes are supported in the plugin yet. | ||
[See issues for more details](https://github.com/robinmetral/gatsby-plugin-pinterest/issues). |
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.
Thanks for adding this 🙏 We can also revisit this README once all options are supported. If it gets too long we could also extract docs to another page, or even deploy a small example site to Netlify 🙂
This looks great, thank you @robinske! @all-contributors please add @robinske for code and doc |
I've put up a pull request to add @robinske! 🎉 |
🎉 This PR is included in version 3.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
Fixes #28
Manually triggers PinUtils.build() for non-hover use cases (hover use case works with existing plugin code).
Why:
Without this, the script only works on page refresh due to the way Gatsby loads 3rd party scripts. There is a similar workaround in the Twitter plugin and a delay in the Google Analytics plugin
Checklist:
This feels like a hack since the PinUtils.build() function isn't explicitly documented, but I've tried a lot of different things to make this work and this is the best option I've found. At the very least it's consistent with the Twitter plugin which is blessed by Gatsby.