Open maximepvrt opened 1 week ago
@farnabaz I was wondering if this feature might be possible with the upcoming v3 of Nuxt Content and the new Collections feature? Would Collections allow us to organize content by domain in separate directories without affecting the URL structure, similar to what I’ve proposed above?
Indeed, this can be done with content collections. Collection are separated entities that can be queried separately. Just like your proposal, content's path will be clean, and they will no prefixes.
Description
I would like to request a feature to enable multi-site support within Nuxt Content by allowing domain-specific directories in the root
content/
folder. These directories should correspond to different domains but should not be reflected in the URL structure, only in the resource paths (i.e., the content'sid
).This feature would be inspired by the syntax introduced in Nuxt 3.13 with Route Groups, which allows organizing routes in directories enclosed in parentheses without affecting the URL structure. For example, in an app with the following structure:
The generated URLs would be
/
,/about
, and/contact
without including themarketing
folder in the URL path.Similarly, in Nuxt Content, this would allow structuring content like this:
Where
site1
andsite2
are different domains, but the resulting URLs would only include the post paths without the domain-specific folders, for example:/blog-post-1
(retrievable fromqueryContent('/site1/blog-post-1').findOne()
)/blog-post-2
(retrievable fromqueryContent('/site2/blog-post-2').findOne()
)Proposed Solution
Utilize a similar approach to Route Groups, where directories enclosed in parentheses (or another syntax) could serve as groupings for different domains or sites. This would enable multi-site support while keeping the URL structure clean.
Benefits