Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Built in support for images under content dir #2163

Closed
DevDengChao opened this issue Jul 12, 2023 · 1 comment
Closed

[Feature request] Built in support for images under content dir #2163

DevDengChao opened this issue Jul 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@DevDengChao
Copy link

DevDengChao commented Jul 12, 2023

Is your feature request related to a problem? Please describe

I'm migrating a blog project from VuePress to Nuxt Content, in order to group related files together, I used to put some png images under _posts dir, eg: _post/awesome-title/example.png, so that I can use it as ./example.png inside _post/awesome-title/index.md.

When migrating, I found Nuxt Content does not support images under content dir by default, which means I have to move those images to public dir and update the references one by one, or I have to write a transformer myself to support this feature.

Describe the solution you'd like

Nuxt Content should be able to handle images under content dir by default.

Describe alternatives you've considered

There is a more detailed examples/guide on how to write a proper transformer.

The transformer example shows how to parse a .names file, but it doesnot render it properly when you visit http://localhost:3000 :
{ "_path": "/", "_dir": "", "_draft": false, "_partial": false, "_locale": "", "_id": "content:1.index.names", "body": [ "Jason", "Jessi", "Joes", "John" ], "title": "", "_source": "content", "_file": "1.index.names", "_extension": "names" }

Additional context

@DevDengChao DevDengChao added the enhancement New feature or request label Jul 12, 2023
@nobkd
Copy link
Contributor

nobkd commented Jul 12, 2023

You can try making a PR for that.

For the time being, you can use Nuxt Content Assets as mentioned in #106 (comment)
There should also be other solutions in the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants