solution-loisir/markdown-it-eleventy-img

Possible to use custom filenames

Closed this issue · 2 comments

Forgive me if this is an obvious solution, I'm a bit of a rookie here.

As per the eleventy-image plugin docs, it's possible to use custom filenames. Is this also a possibility with markdown-it-elevent-img?

Hi there, I've never test this, but I don't see why it wouldn't work. You'd set it on imgOptions. Something of the like:

.use(markdownItEleventyImg, {
  imgOptions: {
    filenameFormat: function (id, src, width, format, options) {
      // Example from the docs.
      return `${id}-${width}.${format}`;
    }
  }
});

Did you tried and got an issue? If it's the case, we can work this out together. Let me know. 😄

That works perfectly thank you!