Creating a file from a tag plugin



I’d like to create a plugin for a custom liquid tag, which both creates some tag result and a binary file (i.e. creates an html img element inside the document, and an image file to be used with it).

However, simply creating the image file – there is no equivalent in the source tree, it’s like a generator task – does not help since jekyll does not recognise this as a wanted file and immediately deletes it.

How do I tell jekyll to keep that file and not erase it?