gatsby-background-image icon indicating copy to clipboard operation
gatsby-background-image copied to clipboard

Support static images

Open petrgazarov opened this issue 3 years ago • 5 comments

Summary

gatsby-image has a handy component StaticImage which allows to use it with static images, rather than coming from GraphQL. It would be great if this package also supported it. I skimmed through docs and issues, but nowhere seems to be any information about it.

Basic example

import BackgroundImage from 'gatsby-background-image';

<BackgroundImage src='../images/main-hero.png' />

Motivation

Support for static images is useful when you have images that aren't served in your GraphQL queries.

petrgazarov avatar Mar 11 '21 22:03 petrgazarov

Hi @petrgazarov!

Yip, that would be a nice addition, though, as I already looked into it, @wardpeet wrote a whole babel plugin for that oO. Gonna see if / when I find the time to replicate that for gbi % ).

Best,

Tim.

timhagn avatar Mar 13 '21 10:03 timhagn

Hi @timhagn :)

Could you please link the plugin that you are referring to? I've quickly skimmed through @wardpeet's repositories to see if I could find it, but I can't.

ChrisCrossCrash avatar Mar 22 '21 09:03 ChrisCrossCrash

Here ya go: babel-plugin-parse-static-images, its meanwhile merged in : ).

timhagn avatar Mar 22 '21 18:03 timhagn

Hi there! As @timhagn momentarily is the main contributor to this package, this issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs, though we're open to suggestions on how to get more maintainers! Thank you for your contributions : )!

github-actions[bot] avatar Apr 08 '21 00:04 github-actions[bot]

Any update on this?

exil0867 avatar Apr 14 '22 23:04 exil0867