N
Nuxt9mo ago
nilssso

Empty @nuxtjs/sitemap with @nuxt/content document driven mode

I'm using @nuxt/content and @nuxtjs/sitemap with the following config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'@nuxt/content',
'@nuxt/ui',
'@nuxtjs/sitemap',
],
content: {
documentDriven: true,
},
})
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'@nuxt/content',
'@nuxt/ui',
'@nuxtjs/sitemap',
],
content: {
documentDriven: true,
},
})
And I have some content
content
├── contact.md
├── glossary.md
├── index.md
├── leadership.md
├── home-owners
│   └── faq.md
└── services
├── 1.special-districts.md
├── 2.fee-studies.md
├── 3.ongoing-reporting.md
├── 4.gis.md
├── 5.arbitrage-compliance.md
├── 6.prop-218-notification.md
└── index.md

2 directories, 12 files
content
├── contact.md
├── glossary.md
├── index.md
├── leadership.md
├── home-owners
│   └── faq.md
└── services
├── 1.special-districts.md
├── 2.fee-studies.md
├── 3.ongoing-reporting.md
├── 4.gis.md
├── 5.arbitrage-compliance.md
├── 6.prop-218-notification.md
└── index.md

2 directories, 12 files
But when I hop over to http://localhost:3000/sitemap.xml I see absolutely nothing. Going off of https://nuxtseo.com/sitemap/integrations/content#document-driven-mode it sounded like no configuration besdies documentDriven: true is necessary
When using documentDriven mode, all paths will be automatically added to the sitemap.
But under #markdown-opt-in it does say
If you want to add markdown pages to your sitemap without any extra config, you can use the sitemap key on your frontmatter. You must provide a loc value, or the page must have a path.
Does this pertain to document driven mode too? As in, even though I can go to http://localhost:3000/leadership, I still need to manually specify loc: /leadership in the markdown frontmatter?
---
title: Leadership
sitemap:
loc: /leadership
---
---
title: Leadership
sitemap:
loc: /leadership
---
And with that the page is included in the sitemap. But is this working as intended?
No description
7 Replies
nilssso
nilsssoOP9mo ago
Sorry about that lol
melodyhook is no longer hooking
ik I did this on purpose to troll
nilssso
nilsssoOP9mo ago
I see I see. Was wondering why @nuxtjs/sitemap autocompleted to you
nilssso
nilsssoOP9mo ago
Oh I guess I just needed to npx nuxt build and npx serve .output/public instead of pnpm run dev. Now I see the whole tree
Want results from more Discord servers?
Add your server