ChristopherBiscardi / gatsby-plugins

A collection of my Gatsby plugins
23 stars 5 forks source link

[gatsby-plugin-printer] feature request: use for regular pages #19

Open Kilian opened 4 years ago

Kilian commented 4 years ago

After implementing gatsby-plugin-printer for my blog posts, I'd also like to use it for regular pages.

There is a different plugin that has code for it here, by updating the generated HTML after compilation: https://github.com/benborgers/gatsby-plugin-og-image/blob/master/gatsby-node.js but if that could be done by gatsby-plugin-printer in some way that would be great.

ChristopherBiscardi commented 4 years ago

technically we could run the resolving code in the graphql resolver instead of onPostBuild. It'll slow the queries down a bit (if you choose to use this feature) since there's processing that has to happen.

You can already do this kind of thing though: because the filename is deterministic you can use the generated filename from the Printer nodes for any image you create