MCT-master / mct-master.github.io

The blog of MCT
https://mct-master.github.io
14 stars 9 forks source link

Lazy loading media content #15

Open jacksongoode opened 4 years ago

jacksongoode commented 4 years ago

Now that much of the heavier media is sourced via a call to G-Drive, it might be useful to have some lazy loading functionality. This would allow the page's text to load first, provide a smoother experience when navigating through the posts, and would look neater compared to empty frames.

One option may be https://github.com/verlok/vanilla-lazyload for a more robust implementation.

However, there is also the option to use native lazy loading, which is included in most modern browsers (excluding Safari). This gem https://github.com/gildesmarais/jekyll-loading-lazy enables this for img and iframe tags with little configuration (this could also be done manually).