Giter Club home page Giter Club logo

Comments (1)

skalka7 avatar skalka7 commented on May 31, 2024

Ideally we need to find a jekyll plugin that reads the asset folder and generate resized version of all the pictures used, so that we can serve different images according to devices thanks to the <picture> element.
We use this solution on signavio.com, this is an example of the code:

<picture>
  <source media="(min-width: 768px)"
  	srcset="https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=1500&amp;h=600&amp;zc=1 1500w,
  		https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=1280&amp;h=512&amp;zc=1 1280w,
  		https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=1000&amp;h=400&amp;zc=1 1000w,
  		https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=800&amp;h=320&amp;zc=1 800w"
  	sizes="100vw" >
  <source  media="(max-width: 767px)"
  	srcset="https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=800&amp;h=525&amp;zc=1 800w,
  	https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=640&amp;h=420&amp;zc=1 640w" >
  <img src="https://www.signavio.com/wp-content/uploads/2016/10/webinar-signavio-zespri-apac.jpg?w=1500&amp;h=600&amp;zc=1" alt="Simplifying Global Supply Chains with BPM - Zespri's Story" />
</picture>

The above code not only provide different resolutions, it takes care of serving images with a different size ration to mobile devices.

I did a quick research and I found a couple of plugins that may be used:

Let me know if you have questions on the topic.

from tech-blog.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.