-
-
Notifications
You must be signed in to change notification settings - Fork 741
Open
Labels
Description
Environment
- Operating System: Darwin
- Node Version: v20.18.0
- Nuxt Version: 3.15.1
- CLI Version: 3.18.2
- Nitro Version: 2.10.4
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, features, future, modules, colorMode, ui, runtimeConfig, content, routeRules, nitro, css, plausible, $production, linkChecker, sitemap, compatibilityDate
- Runtime Modules: @nuxt/[email protected] (35d9af7), @nuxt/[email protected] (85010c1), @nuxt/[email protected], @nuxtjs/[email protected], @vueuse/[email protected], @nuxtjs/[email protected]
- Build Modules: -
Reproduction
Code Example
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**',
schema: z.object({
name: z.string()
})
}),
devenirBenevole: defineCollection({
type: 'page',
source: 'devenir-benevole/**/*.yml',
}),
blogEngagement: defineCollection({
type: 'page',
source: 'blog-engagement/*.md',
schema: z.object({
date: z.string()
})
}),
}
})Describe the bug
When modifying a file that belongs to multiple collections, only the first collection in defineContentConfig is updated during live reload. This creates issues when trying to manage a global navigation by combining multiple collections.
Expected Behavior
- All collections referencing the modified file should update during live reload.
Additional context
Proposal
A built-in function (e.g., useGlobalNavigation()) to return a global navigation combining all collections would be very helpful, eliminating the need for custom merging. A function like useGlobalNavigation() could return a unified structure of pages with essential metadata (title, path, etc.) from all collections:
const navigation = useGlobalNavigation()