Skip to content
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

Load images locally and not through CDN #143

Open
ghost opened this issue Dec 4, 2020 · 4 comments
Open

Load images locally and not through CDN #143

ghost opened this issue Dec 4, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 4, 2020

Is it possible to setup this so images from body posts are loaded locally without contentful CDN?

@ghost
Copy link
Author

ghost commented Dec 4, 2020

I asked this question on Gatsby discussion but no one answered
gatsbyjs/gatsby#28104

@axe312ger
Copy link
Contributor

We do not recommend to work around our CDNs and directly use our Image API. Thats what the gatsby plugin does.

Whats your reason for doing this?

You still can do it: (I assume you use Markdown)

  1. First enable downloadLocal in gatsby-source-contentful
  2. create a remark plugin similar to https://www.gatsbyjs.com/plugins/gatsby-remark-images-contentful/ that rewrites the image tag src to your local path

@ghost
Copy link
Author

ghost commented Dec 9, 2020

@axe312ger
Thanks, have you seen an example in the past? I am wondering if anyone has done something similar to this, I dont think I can write a plugin yet :( , I enabled downloadLocal but none of the images are downloaded.

@axe312ger
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant