Open bloodf opened 2 years ago
Have you ever tackled this? I'm looking for a solution where I can fetch plain MD from my server and make nuxt-content render it. Or even render the json body of MD and store it in my DB and make ContentRender component to render it!
Is your feature request related to a problem? Please describe
When using
nuxt-content
to fetch articles from dev.to, with a custom driver. The current process will try to fetch all the items in the first call, and we have to add the file extension direct inside thekey
of the items list. For example${key}.md
This process triggers API throttling and blocks the usage of the
nuxt-content
+ custom drivers.Describe the solution you'd like
Ideally, if we could add an option in the driver object, which it describes as lazy loaded content, the
unstorage
will behave the same, but only fetch the item's content when it's requested by the content API.Also declaring the type of file extension or transformer that will be used in the handling of the
getItem
will remove the need to make the driver create keys as${key}.md
, because when fetching from the API the URL becomeshttps://dev.to/api/articles/955318.md$
I've created a repository with the custom driver and the error of multi-loading.
https://github.com/bloodf/nuxt_content_lazyload_driver
Describe alternatives you've considered
Another alternative for this is creating a component that takes a
markdown
content plain instring
and renders it, using thenuxt-content
behavior.Or have an API that receives the string a post param and returns the
markdown
object used bynuxt-content
so we can use the internalMarkdownRenderer
component to render.Additional context
This usage case it's good for implementing a headless CMS with
nuxt-content
, where open drivers to blog platforms like dev.to, hackernoon and othermarkdown
blogs, which will enable people to use it, and use the platforms as purely "Editors"