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

fix: support multiple image fields on one node type #34

Merged
merged 2 commits into from
Dec 23, 2019
Merged

fix: support multiple image fields on one node type #34

merged 2 commits into from
Dec 23, 2019

Conversation

wKovacs64
Copy link
Contributor

Closes #33

@wKovacs64
Copy link
Contributor Author

Also survives cached rebuilds, now.

@graysonhicks
Copy link
Owner

Good stuff, thanks!

@graysonhicks graysonhicks reopened this Dec 23, 2019
@graysonhicks graysonhicks merged commit ae663ae into graysonhicks:develop Dec 23, 2019
@wKovacs64 wKovacs64 deleted the fix/multiples branch December 23, 2019 15:59
@wKovacs64
Copy link
Contributor Author

Cool. You'll probably want to release a v2.0.1 that includes this fix for v2 folks.

@kpennell
Copy link

kpennell commented Jan 5, 2020

@graysonhicks Struggling here. I'm guessing we can't use two images on one node? ie this stopped working:


    {
      resolve: "gatsby-plugin-remote-images",
      options: {
        nodeType: "item",
        imagePath: "thumbnail",
        name: "optimized_thumbnail",
      },
    },
    {
      resolve: "gatsby-plugin-remote-images",
      options: {
        nodeType: "item",
        imagePath: "instructor_image",
        name: "optimized_instructor_image",
      },
    },

It only uses the latter item

package.json

{
  "name": "gatsby-starter-default",
  "private": true,
  "description": "A simple starter to get up and developing quickly with Gatsby",
  "version": "0.1.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "@material-ui/core": "^3.9.3",
    "@material-ui/icons": "^3.0.2",
    "axios": "^0.19.0",
    "dotenv": "^8.0.0",
    "gatsby": "2.18.17",
    "gatsby-awesome-pagination": "^0.3.5",
    "gatsby-cli": "^2.7.28",
    "gatsby-image": "^2.2.33",
    "gatsby-plugin-manifest": "^2.0.24",
    "gatsby-plugin-material-ui": "^1.2.4",
    "gatsby-plugin-modal-routing": "^1.1.0",
    "gatsby-plugin-netlify-cache": "^1.2.0",
    "gatsby-plugin-nprogress": "^2.1.17",
    "gatsby-plugin-react-helmet": "^3.1.15",
    "gatsby-plugin-remote-images": "^2.0.0",
    "gatsby-plugin-sharp": "^2.3.5",
    "gatsby-plugin-sitemap": "^2.2.22",
    "gatsby-plugin-web-font-loader": "^1.0.4",
    "gatsby-remark-copy-linked-files": "^2.0.11",
    "gatsby-remark-images": "^3.1.39",
    "gatsby-remark-relative-images": "^0.2.1",
    "gatsby-source-filesystem": "2.1.43",
    "gatsby-transformer-remark": "^2.3.4",
    "gatsby-transformer-sharp": "^2.3.6",
    "lodash": "^4.17.15",
    "memoize-one": "^4.0.2",
    "moment": "^2.24.0",
    "prop-types": "^15.7.2",
    "react": "^16.8.4",
    "react-dom": "^16.8.4",
    "react-fontawesome": "^1.7.1",
    "react-helmet": "^5.2.0",
    "react-instagram-embed": "^1.5.0",
    "react-scripts": "2.0.5",
    "react-select": "^3.0.8",
    "react-virtualized-auto-sizer": "^1.0.2",
    "react-window": "^1.2.2"
  },
  "devDependencies": {
    "prettier": "^1.16.4"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write src/**/*.{js,jsx}",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

@kpennell
Copy link

kpennell commented Jan 5, 2020

Yep, reverting to 1.0.7 fixed it! All good. Will wait. Silly me using dependabot and not testing.

@wKovacs64
Copy link
Contributor Author

@kpennell Yeah, this fix didn't get released yet. Waiting on a v2.0.1 or whatever. Sorry for the hassle.

@kpennell
Copy link

kpennell commented Jan 5, 2020

@wKovacs64 no prob. great plugin.

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

Successfully merging this pull request may close these issues.

Impossible to add two image fields in the same node
3 participants