Brian
Brian
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
No description
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai Are you sure I should define content directory configuration in my root nuxt.config.ts file if where I am using the @nuxt/content module is in /blog and that layer is properly extended to the rest of the project? Also, is the sources key valid on the content object in Nuxt Content 3.2.2? I am getting TypeScript errors and that looks like maybe an older version of defining source.
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai Could Nuxt Content not finding my markdown files have anything to do with dir: { pages: '~/site/pages' }} being defined on the root nuxt.config.ts file and me trying to match markdown files in blog/content/mypost.md to a url of [site.com]/mypost ?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai Thanks, I do have modules: ['@nuxt/content'] in the nuxt.config.ts of /blog already.
Are there any issues with having front matter defined in the markdown files if I don't have a schema object defined in my content.config.ts file? I only have title and description defined but would these cause any issues with no schema defined? Should I remove the front matter portion from my markdown files. Front matter is any content between a set of --- at the top of the markdown file correct?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai If I have a content.config.ts file defined in my /blog layer, do I need anything related to Nuxt Content defined in the nuxt.config.ts file of the /blog layer? And if I have /blog, /core , and /site layers at the root of my project, each with their own nuxt.config.ts files and I extend them in the root nuxt.config.ts file with a extends: ['blog', 'core', 'site'] would that be sufficient to correclty reference and extend those layers to the whole Nuxt project?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai The Nuxt Content documentation somtimes uses collections: { docs: defineCollection() } } and sometimes collections: { content: defineCollection() } } in example content.config.ts files to define collections. Which one should I use if my markdown files reside in /blog/content ?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
Hey @leamsigc thanks for your reply and for your project reference. Yeah, my content.config.ts contains:
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
}),
},
});
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
}),
},
});
Which is the same as the suggested setup in the installation docs. It just lives in a Nuxt Layer in the /blog of the project root. I'm expecting it to work the same as your example and grab all the markdown in /blog/content as oppose to where you have the files in /content at the root. I also have the [...slug].vue file in /blog/pages which seems to follow the Document Driven section of the migration docs Given the dev server says 0 files from 2 collections are being processed, I think I need to fix what I am putting in source:. And I need to understand why it gets two collections when I thought I was only defining one collection. That could be the cause of the issue too maybe. @kapa.ai When defining Nuxt Content collections, I don't need to define the schema object in my content.config.ts file right? User leamsigc has the schema object defined in a Nuxt Content implementation. I do not have it defined, but that is ok right? Setting up Nuxt Content in a Nuxt Layers project, do I have to remap the directory of the default /content folder that lives at the root of a Nuxt project normally to the layer folder where I would like my markdown content to reside? For my example do I need to map the /content directory to /blog/content in the root nuxt.config.ts if I am setting up Nuxt Content within a /blog layer? And I am ok to add the @nuxt/content module in the nuxt.config.ts file of the /blog layer folder? And Nuxt Layer folders can reside at the root of a project as opposed to the /layers folder at the root right?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai I've tried a few variations of the changes you suggested by testing different versions of the source value including the one you mentioned. @nuxt/content still doesn't seem to be picking up the markdown files. Using blog: defineCollection() I've tried '**', 'content/**', 'content/**/*.md', and 'content/*.md'. For more context, my root nuxt.config.ts extends the layers and also maps some directories in this way:
extends: ['blog', 'core', 'site'],
dir: {
assets: '~/core/assets',
layouts: '~/site/layouts',
pages: '~/site/pages',
extends: ['blog', 'core', 'site'],
dir: {
assets: '~/core/assets',
layouts: '~/site/layouts',
pages: '~/site/pages',
I wouldn't need to add my /blog layer to dir since it should be extending properly to the rest of the project with the extends array right? And I'm fine to not add modules: ['@nuxt/content'] to this root nuxt.config.ts file right?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai Are you free now? Any thoughts on my last message?
53 replies
NNuxt
Created by Brian on 2/26/2025 in #❓・help
Nuxt Content in a Nuxt Layers project basic setup help
@kapa.ai Hmm, I've tried a few variations of the changes you suggested by testing different versions of the source value including the one you suggested. @nuxt/content still doesn't seem to be picking up the markdown files. Using blog: defineCollection() I've tried '**', 'content/**', 'content/**/*.md', and 'content/*.md'.
For more context, my root nuxt.config.ts extends the layers and also maps some directories in this way:
extends: ['blog', 'core', 'site'],
dir: {
assets: '~/core/assets',
layouts: '~/site/layouts',
pages: '~/site/pages',
extends: ['blog', 'core', 'site'],
dir: {
assets: '~/core/assets',
layouts: '~/site/layouts',
pages: '~/site/pages',
I wouldn't need to add my /blog layer to dir since it should be extending properly to the rest of the project with the extends array right? And I'm fine to not add modules: ['@nuxt/content'] to this root nuxt.config.ts file right?
53 replies