content icon indicating copy to clipboard operation
content copied to clipboard

How to handle content assets?

Open frank-laemmer opened this issue 9 months ago • 3 comments
trafficstars

I see there is Nuxt Studio which looks super cool. But I'd like to deploy my Nuxt Content V3 elsewhere. My 'content' folder itself is a repo of markdown files. I'd like to store and serve images with and from the content folder. To keep the content images with the markdown content files. I'd like to link those local images from Markdown. Imagine that I use Obsidian to author the content like so:

![View from the hotel](images/hotel-view.jpg)

So far I have been using Nuxt Content Assets with Nuxt Content V2: https://github.com/davestewart/nuxt-content-assets

But the plugin does not seem to be maintained, nor does it work with Nuxt Content 3.

What options, beside Nuxt Content Studio, are available?

I am not considering public and assets folder from Nuxt, since I want to store those content assets with the content repo. The content repo should be independent of the Nuxt application. I have asked this on Discord before.

frank-laemmer avatar Feb 17 '25 07:02 frank-laemmer

The author replied two weeks ago; see https://github.com/davestewart/nuxt-content-assets/issues/90.

But it is a thing so basic, that I would expect to be to be a core part of Nuxt Content.

stared avatar Mar 20 '25 15:03 stared

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 19 '25 16:05 github-actions[bot]

Can we re-open this? I'm not sure about Nuxt Studio, but hosting all the assets in the public or assets folder sounds like a red-flag to me too :(

nonlinearcom avatar May 27 '25 14:05 nonlinearcom

Hi @farnabaz, what do you think? I asked for updates to the maintainer 4 months after he answered that he would be back to OSS in a week. Unfortunately, we haven't received a response yet. Does it make sense to you for this to be integrated into Nuxt Content? If we ignore the WS part that he was forced to replicate, it doesn't seem like there's a lot to do.

DraftProducts avatar Jul 17 '25 01:07 DraftProducts

@DraftProducts

Well, I did it in my repo, dropping the nuxt-content-assets dependency.

https://github.com/stared/stared.github.io/pull/12

Loot at copy:assets https://github.com/stared/stared.github.io/pull/12/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 and https://github.com/stared/stared.github.io/pull/12/files#diff-66cedf214901bc9543871a00a6e21ab77a1f882b40a8271843fac8f2eeb57f05.

It is a hacky way (tl;dr: just copy images to the public folder with a script)., but works. Very likely it is possible to do it in a simpler way, just https://www.npmjs.com/package/vite-plugin-static-copy.

stared avatar Jul 17 '25 18:07 stared

Hi @stared thank you for your advice! Actually, nuxt-content-assets cover a lot of use cases and issues with images. For me and i think most of the cases, copying files isn't enough. Hope we get a proper integration in Nuxt content.

DraftProducts avatar Jul 22 '25 14:07 DraftProducts

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 20 '25 15:09 github-actions[bot]

This issue isn't stale, it is still not possible to migrate to content v3 since there is still no way to support images from github source like it was possible with Nuxt Content Assets module only compatible with content v2.

DraftProducts avatar Sep 25 '25 15:09 DraftProducts

@farnabaz up

DraftProducts avatar Oct 07 '25 21:10 DraftProducts

Big up from me here as well

stijns96 avatar Nov 06 '25 10:11 stijns96

"Solved" the problem by migrating to Astro (https://github.com/stared/stared.github.io/pull/16 and https://github.com/stared/stared.github.io/pull/17)

stared avatar Nov 06 '25 11:11 stared