davestewart / nuxt-content-assets

Enable locally-located assets in Nuxt Content
https://npmjs.com/package/nuxt-content-assets
108 stars 7 forks source link

Support custom unstorage drivers #42

Open shareable-vision opened 11 months ago

shareable-vision commented 11 months ago

Background

The promise of using the unstorage layer with Nuxt/Content/Assets is to be able to plug in any of a variety of sources.

Proposal

Studying the makeSourceStorage() of src/runtime/assets/source.ts, it appears that the module currently supports either the fs or github unstorage driver or defaults to the memory driver. I propose that the Nuxt Content Assets module support custom unstorage drivers as well following along the same pattern as the Nuxt Content module.

shareable-vision commented 11 months ago

I just wrote a webdav driver for unstorage. My goal is for authors to be able to simply write content on their own desktop or online via NextCloud. This currently works with Nuxt Content module, although I needed to submit a PR for Nuxt Content to build with custom drivers (https://github.com/nuxt/content/pull/2193).

davestewart commented 11 months ago

Hey there!

Seems like a reasonable proposal.

I haven't looked at the code for a while so don't have any thoughts right now but was planning to look at a couple of tickets in the next week or so.

Feel free to experiment between now and then and I'll get back to you :)

shareable-vision commented 11 months ago

I would be glad to help out . . I love the architecture of serving from plain directory of markdown (or MDC) and assets. The Content module really needs Content-Assets to be fully functional.

(I edited my comments here to stay on topic, and extracted proposal to support dynamic content.)