Skip to content

Feature Request: Multi-site support with domain-based content directories #2807

@maximepvrt

Description

@maximepvrt

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's id).

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:

-| pages/
---| index.vue
---| (marketing)/
-----| about.vue
-----| contact.vue

The generated URLs would be /, /about, and /contact without including the marketing folder in the URL path.

Similarly, in Nuxt Content, this would allow structuring content like this:

-| content/
---| (site1)/
-----| blog-post-1.md
---| (site2)/
-----| blog-post-2.md

Where site1 and site2 are different domains, but the resulting URLs would only include the post paths without the domain-specific folders, for example:

  • /blog-post-1 (retrievable from queryContent('/site1/blog-post-1').findOne())
  • /blog-post-2 (retrievable from queryContent('/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

  • Simplifies multi-site setups without needing complex folder structures or custom routing.
  • Allows managing multiple domains within the same content repository.
  • Keeps the URL structure clean and focused on the content, without referencing domain-specific organization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions