Search code examples
gatsbygatsby-image

Inline Images in Gatsby Wordpress source plugin


I'm using this plugin https://www.gatsbyjs.com/plugins/@draftbox-co/gatsby-wordpress-inline-images/ following all instructions, but does not work.

Does anyone know what could be going wrong?

gatsby-config.js:

{
      resolve: 'gatsby-source-wordpress',
      options: {
        excludedRoutes: [
          '/wp/v2/users/**',
          '/wp/v2/settings*',
          '/wp/v2/themes*'
        ],
        baseUrl: 'domain',
        protocol: 'http',
        postTypes: ["post", "page"],
        plugins: [
          {
            resolve: `@draftbox-co/gatsby-wordpress-inline-images`,
            options: {
              baseUrl: `domain`,
              protocol: `http`
            }
          }
        ],
        hostingWPCOM: false,
        useACF: true,

        searchAndReplaceContentUrls: {
          sourceUrl: 'http://domain',
          replacementUrl: ''
        }

        
      }
    },

My Gatsby Blog


Solution

  • I could access the wordpress site both http and https. I just change protocol url (gatsby plugin config) to https and works

          resolve: 'gatsby-source-wordpress',
          options: {
            excludedRoutes: [
              '/wp/v2/users/**',
              '/wp/v2/settings*',
              '/wp/v2/themes*'
            ],
            baseUrl: 'domain.net',
            protocol: 'https',
            postTypes: ["post", "page"],
            
            plugins: [
              {
                resolve: '@draftbox-co/gatsby-wordpress-inline-images',
                options: {
                  baseUrl: 'domain.net',
                  protocol: 'https',
                  withWebp: true,
                }
              }
            ],
            hostingWPCOM: false,
            useACF: true,
    
            searchAndReplaceContentUrls: {
              sourceUrl: 'https://domain',
              replacementUrl: ''
            }
    
            
          }