eexit / ghost-storage-cloudinary

:rocket: A fully-featured and deeply tested Cloudinary Ghost storage adapter
https://ghost.org/integrations/cloudinary/
81 stars 21 forks source link

Fall back to images in content/images/ if file exists? #89

Closed ndbroadbent closed 4 years ago

ndbroadbent commented 4 years ago

Hello,

I'm setting up Ghost on Heroku via the awesome ghost-on-heroku. This provisions the Cloudinary resource and sets up ghost-storage-cloudinary by default.

My problem is that I have already migrated a lot of my blog posts to a Ghost(Pro) instance before I decided to host my own instance on Heroku. I was able to export all of my posts from Ghost(Pro) as JSON, and I downloaded all of the images by scraping the blog using wget --recursive. So I copied all of these historical images into content/images/. If I disable Cloudinary by unsetting the CLOUDINARY_URL, then everything is working great and all the images load properly.

However, when the ghost-storage-cloudinary storage is configured in this code, the server can no longer serve any of my images in the content/images/ folder.

I was wondering if it would be possible to support a hybrid approach where any new images are uploaded to Cloudinary, but this library also checks for any hard-coded images inside the content/images/ folder?