Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Download images locally #54

Open
ghost opened this issue Jul 16, 2019 · 6 comments
Open

Download images locally #54

ghost opened this issue Jul 16, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Jul 16, 2019

Is it possible to download images locally and server them via custom domain?

@bit-crafter
Copy link

Hi @littlehamster, you can try this Download assets for static distribution

Enable this feature with the downloadLocal: true option.

@ghost
Copy link
Author

ghost commented Jan 27, 2020

@tumdav
was this recently updated?

@ghost
Copy link
Author

ghost commented Jan 27, 2020

I set this to true but images are still loaded via their domain, any ideas?

@raubin
Copy link

raubin commented Feb 14, 2020

I tried to use this config setting as well and it did not pull down Contentful images. I verified by checking the static assets folder after build. In my case I was trying to pull embedded assets for Rich Text fields and Markdown Long Text fields. I did not try with separate media fields.

@bit-crafter
Copy link

bit-crafter commented Feb 14, 2020

I set this to true but images are still loaded via their domain, any ideas?

@littlehamster you have to query files on this way

  query BlogPostBySlug($slug: String, $locale: String) {
    contentfulBlogPost(slug: { eq: $slug }) {
      title
      publishDate(formatString: "MM/DD/YYYY")
      image {
        localFile {
          childImageSharp {
            fluid(maxWidth: 1180) {
              ...GatsbyImageSharpFluid_withWebp_noBase64
            }
          }
        }
      }
      body {
        childMarkdownRemark {
          html
        }
      }
    }
  }

@bit-crafter
Copy link

I tried to use this config setting as well and it did not pull down Contentful images. I verified by checking the static assets folder after build. In my case I was trying to pull embedded assets for Rich Text fields and Markdown Long Text fields. I did not try with separate media fields.

maybe you can find something helpful here

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

No branches or pull requests

2 participants