Gatsby Static Image (gatsby-plugin-image) // Speed Up Your Website with This Gatsby Plugin

Поделиться
HTML-код
  • Опубликовано: 12 дек 2024

Комментарии • 39

  • @whereislolly
    @whereislolly 3 года назад +1

    Cool :P Thank you SO much for the clear tutorial!!

  • @eltonsantos8804
    @eltonsantos8804 3 года назад

    It' s amazing! Im gonna use it. Tks Teacher

  • @kokoyroy
    @kokoyroy 3 года назад

    u do awesome work dude!

  • @elendil4543
    @elendil4543 3 года назад

    thank you man that was awesome

  • @akshar_dave
    @akshar_dave 2 года назад

    Thank you for this!

  • @argonfly
    @argonfly 3 года назад

    Thanks for the video. How would you do rounded corners on this? I have trouble adding a css class using the imgClassName tag

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад +2

      In JSX, it’s className. And I’d use the css property border-radius and round the parent.

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  2 года назад

      @@bbhai7083 I’m all booked up unfortunately.

  • @jaynsw
    @jaynsw 3 года назад

    StaticImage doesn't depends on file source plugin

  • @codingchannels4103
    @codingchannels4103 3 года назад

    is there a way to have art direction with staticimage? I know its possible with dynamic images

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  2 года назад

      You'd have to use GraphQL in conjunction with a CMS for art direction.

  • @nomanarshad3888
    @nomanarshad3888 3 года назад

    If i have to provide the height to the static image then? Should i simplay write height ={} and provide the number in curley brackets ?

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      You don't have to write the height unless you want a fixed image (which I don't recommend). You don't event have to use GraphQL. Check out the docs for it, as your situation might be a little different than mine:
      www.gatsbyjs.com/plugins/gatsby-plugin-image/
      Your code can be as simple as this:
      (note that the image location this way is different then in GraphQL).
      I'll bump my carousel / StaticImage tutorial up for you.

    • @nomanarshad3888
      @nomanarshad3888 3 года назад

      Thank you sir. It helped me alot

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      You are so welcome. I'm currently working on updating my Gatsby mini-course. Happy to give you complimentary access once I release it next week. Shoot me your email: adesignerwhocodes.com/contact/ and I'll give you comped access. Always happy to help!

  • @nestordanielgomezacuna
    @nestordanielgomezacuna 3 года назад

    Hi! I have a question.
    I need to create a multiple cards each containing a .svg file. How can I map all the svg images so that the cards are automatically created from a json / js file?
    Thank you!

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад +1

      You could use GraphQL and map your data from a json / js file. Static image won’t work with svg files so go old school and use img src.

  • @godamkeras4144
    @godamkeras4144 3 года назад

    i followed all steps, but the image still wont appear, the graphql shows that they read my image, and also update latest version of gatsby.. still not working.. sigh

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      It’s always tough the first time. Download my source code and compare. You’ll get it.

    • @godamkeras4144
      @godamkeras4144 3 года назад

      @@ADesignerWhoCodes got em thank you so much!

  • @lukas85s
    @lukas85s 3 года назад

    What is the theme in VSC?

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад +1

      I believe it’s the default theme. I’ve tried not to change it so it would look familiar when watching the videos. 😊

  • @SeaRich
    @SeaRich 3 года назад

    Is there a background image api in v3?

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      There sure is! ruclips.net/video/d5i00ZN2Tuw/видео.html (you'll need to still install Gatsby Background Image but this works as a bridge)

    • @SeaRich
      @SeaRich 3 года назад

      @@ADesignerWhoCodes thanks! Cuz I’ve left for nextjs for a while. I’d like to check the docs about the SVG as well. You’re awesome 👏

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      @@SeaRich I hear next is great. But for most sites, Gatsby just rocks. One of these days I’ll delve into Next. Thank you!

  • @BobbyBundlez
    @BobbyBundlez 3 года назад

    is there any way to query dynamic images? why does the src have to be hard coded? really irritating and sooo over the top complex lol

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      I actually love this. The proof is in Google’s PageSpeed Insights when pages get high 90s. What do you mean by dynamic images?

    • @BobbyBundlez
      @BobbyBundlez 3 года назад

      @@ADesignerWhoCodes dynamic queries. I get that Gatsby is great for blogs etc. But I just tried to migrate an old iq test app to Gatsby and the ability to query dynamic images is hard. As In the inages served r dynamic. In my case when u press next page a random question comes up with appropriate image. Wish it was as simple as putting a parameter like graphql but it isn’t....

    • @BobbyBundlez
      @BobbyBundlez 3 года назад

      @@ADesignerWhoCodes please help! Lol

    • @BobbyBundlez
      @BobbyBundlez 3 года назад

      @@ADesignerWhoCodes and don’t get me wrong I see the power of gatsby. Our app currently went from a 54 page speed to currently 89. BUT this dynamic image querying is killing me

    • @ADesignerWhoCodes
      @ADesignerWhoCodes  3 года назад

      Gatsby is primarily used as a SSG, or a static site generator. They do have the ability to beyond that. It just takes some more work to do that, as it will be essentially server side rendered or SSR. Here's some info that may help you:
      www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/
      Server side rendering is much more complex because there are if/then/else statements effectively. But you could ride a JavaScript file that loads images in remotely. I've brought in remote JS scripts before using React Helmet to somewhat make it dynamic.
      Nope. It is harder. I hear ya.

  • @MrNison79
    @MrNison79 3 года назад

    👍👍👍👍👍