question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provides a plugin to optimise images (resize, placeholder)

See original GitHub issue
  • I’ve read the [contribution guidelines][1] and agree with them

I want to suggest an idea and checked that …

  • … to my best knowledge, my idea wouldn’t break something for other users
  • … the documentation does not mention anything about my idea
  • … there are no open or closed issues that are related to my idea

Description

Loading images is a pain.

Too big images could slow the webpage loading by a bunch.
It would be great if mkdocs could optimize the rendering of the image.

Hopefully, the tech has evolved in the last 5 years, with support for:

  • <figure> HTML component
  • SVG / blurhash placeholder

For example, another web static content generator (gatsby) provides plugins to:

  • resize image
  • generate a placeholder image (eg using blur hash: https://blurha.sh/)
  • wrap the low res and high res image in a <figure> HTML component

Checks for instance: https://using-gatsby-image.gatsbyjs.org/

Use Cases

  • This would improve loading page
  • This would prevent the flickering effect.

Screenshots / Mockups

Loading Loaded
image image

Notes

As it is doable inside a plugin, I would say it would be a nice addition for the mkdocs-material (insiders?), and at least does require to be implemented in mkdocs itself.

My company (BAM) is sponsoring MKDocs Material.
Also, I may be available to help implement this, with some guidance, if that is easier for you.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:14
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
waylancommented, May 20, 2021

As explained, we do not include plugins with MkDocs directly. All plugins should be developed as separate projects from the core. In addition to keeping the maintenance burden down, it also frees the plug-in from MkDocs’ slower development cycle

0reactions
tychotacommented, May 20, 2021

OK, thanks @squidfunk and @waylan for explanation.

I will try my best to build an image compression/placeholder pipeline plugin. And ask for help if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Optimize Images for Web and Performance - Halo Lab
Cloudflare Image Resizing is used to resize images, adjust their quality and convert them to AVIF or WebP formats if needed. Cloudflare Image ......
Read more >
11 Best WordPress Image Optimization Plugins 2022 [GUIDE]
This plugin allows you to optimize JPEG and PNG formats. It is based on the famous image compression services of TinyJPG and TinyPNG....
Read more >
6 Best WordPress Image Optimizer Plugins (Tested and ...
ShortPixel Image Optimizer ; Optimole; Imagify; EWWW Image Optimizer; Compress JPEG & PNG images by TinyPNG; Smush Image Compression and ...
Read more >
How To Optimize Your Images For WordPress - WP Engine
Smush's image compression plugin works to resize, optimize, and compress all of your images for the web, so they load faster than before....
Read more >
Top 10 Best WordPress Images Optimization Plugins
Imsanity is an images optimization plugin that allows you to automatically resize huge images that are uploaded to the size that is viable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found