Gatsby: [gatsby-source-wordpress] Prevent media from downloading

Created on 9 Jul 2019  路  3Comments  路  Source: gatsbyjs/gatsby

Hello,

Is it possible to stop the plugin from downloading media? For a website with a ton of photos, including the images would just bloat up the public folder.

awaiting author response

Most helpful comment

Still on this issue, sometimes you will want to use a media url but i I omit the "media" route I can't access, for example, the "featured_media" property in a post node. Is there a way I could get only the URL but not download the media?

All 3 comments

@geeknabe yes it is. In your gatsby-config.js you can omit the "**/media" route and all of the images will be sourced directly from the wordpress instance. But don't forget that as all of the images in the pages or posts will be sourced directly from the wordpress installation, they are not available and need to be downloaded when the page is shown/rendered. That's why the route mentioned above in conjunction with the plugin is a better way, so that you have all of the images at build time and you can transform them as needed.

Feel free to provide feedback so that we can close this issue or continue to work on it till we find a suitable solution for your issue.

Alright, thanks for the info!

Still on this issue, sometimes you will want to use a media url but i I omit the "media" route I can't access, for example, the "featured_media" property in a post node. Is there a way I could get only the URL but not download the media?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbrandin picture timbrandin  路  3Comments

magicly picture magicly  路  3Comments

benstr picture benstr  路  3Comments

signalwerk picture signalwerk  路  3Comments

dustinhorton picture dustinhorton  路  3Comments