gatsby-contentful-portfolio | Portfolio theme for Gatsby | Portfolio library
kandi X-RAY | gatsby-contentful-portfolio Summary
kandi X-RAY | gatsby-contentful-portfolio Summary
Portfolio theme for Gatsby
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-contentful-portfolio
gatsby-contentful-portfolio Key Features
gatsby-contentful-portfolio Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-contentful-portfolio
QUESTION
I'm an iOS developer and I've been struggling for what seems like the longest time making my portfolio site from scratch. I've tried a bunch of different technologies and have finally settled on using Gatsby to create it.
So far things have been fairly straightforward but I can not figure out for the life of me how to get a component that looks like the picture below. I've gotten most of the layout design working, but I can't seem to use graphql to query the images I need in the component.
Desired LayoutI've found plenty of Gatsby example templates such as this one and this one that are similar. However the main difference is that each of these only have one image and they seem to be using Gatsby 2.0 instead of 3.0.
I can get one image using "useStaticQuery", however I need access to different images for each component. From my understanding this is not possible to do within a component, only on a page. I also can not pass the image path as a variable to StaticImage either.
...ANSWER
Answered 2021-Apr-28 at 18:22You have a few options:
- Query for all of your image data in your page query and prop-drill the data to the component that uses it to display the image.
- Using Gatsby v3+, hardcode the image references for each component using the new
StaticImage
component. - If you have a single component used multiple times with different content/images, but a static parent component with your content, you can leverage option #2 above but pass the image component down as a prop or children.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-contentful-portfolio
This project comes with a Contentful setup command npm run setup. This command will ask you for a space ID, and access tokens for the Contentful Management and Delivery API and then import the needed content model into the space you define and write a config file (.env).
If you want to use built-in integration with Mailchimp, please provide your unique endpoind URL in the .env file (MAILCHIMP_ENDPOINT variable). Follow this instruction to get the endpoint value.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page