content icon indicating copy to clipboard operation
content copied to clipboard

Support top-level array in JSON files

Open jeannen opened this issue 8 months ago • 2 comments

Is your feature request related to a problem? Please describe

When working on SEO, there are many instances where creating a single JSON array file is MUCh more convenient than having hundreds of small files, especially when working with AI. If I want to change something to all my content, I would either have to manually change files one by one, or ask Cursor to go through every file and edit it, which is much more expensive AND complex than editing a single file

Describe the solution you'd like

Simply being able to have one single JSON file for all my documents.

Describe alternatives you've considered

I tried creating a collection with a sub-property array, but it does not support large arrays, after 96 or so I get an error (does not seems related to the length but more the size of the file. I made some tests and it seems like 59kb is the size after which it crashes, with syntax error near "collectionName", no matter what the syntax is)

Additional context

jeannen avatar Apr 23 '25 02:04 jeannen

Have you tried creating a custom source for your collection? https://content.nuxt.com/docs/advanced/custom-source Your goal is very similar to the custom source example in the docs.

farnabaz avatar Apr 24 '25 09:04 farnabaz

Mhhm, but how could I get the JSON file from the content folder then? I'd rather not create an API endpoint just for that

jeannen avatar May 08 '25 04:05 jeannen

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 Jul 07 '25 04:07 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Aug 06 '25 04:08 github-actions[bot]