Custom Editor Image Block?

I am very happy with the editor, but want to customize my image block that is inserted by the editor.

For example:

  • a good practice on images is to include the image DIMENSIONS in either size or height/width tags. in jekyll i use a plugin, but the editor block doesn’t include that plugin!
  • another good practice is LAZY LOADING images. I follow css tricks suggestions, but its hard to do this with the netlify editor.

My image blocks look like:

  size="{% imagesize post.thumbnail:size %}"
  class="card-img lazy"

and i have a jeklly component which can be utilized like:

{% include lazyimg.html 

How can I get the editor image widget to render something that is a little more customized?

My thought is to add another component with HIDDEN src and size attributes. but the regex is gnarly to get this to render back into the editor.

Another bonus would be a simpler playground for creating these widgets!!!

Hi @blairanderson, you could use a custom editor component:

and use the exiting image block as a reference:

Thanks @erez! What is the easiest way to build a custom component with live data without testing in production?

Hi @blairanderson, we support local development via: