Hello,
I’m writing some plugins for Publii and I would like to give users the choice to either download the assets being used or include them from a CDN.
Within beforeRender I successfully used https.get to download some files, but I couldn’t manage that the files would then be reliably copied by copyPluginFiles? (Promise, filehandle.sync, etc)
Would it be possible to extend the plugin API to include an asset download function? I would be very grateful for that.
/**
* Download file to input/media/PLUGIN_NAME/
*/
downloadFile (fileUrl, fileName, pluginInstance) // returns true or false