Support sitemap creation when using generate payload

Jered
0
Jered
commented 3 months ago

What problem does this feature solve?

When using generate with dynamic routes you return the routes as an array of string URLs which the sitemap module picks up and creates a correct sitemap.xml. However, if you return the routes object from generate to use the payload feature, the sitemap will fail because it expects a string instead of an object.

What does the proposed changes look like?

Make it so sitemap can use generate.routes when using payloads. Should be updated to also accept routes in the form of:

[
  {
    route: 'urlstring', 
    payload: {data object},
    ...
  }
]

and extract the route.

idea
0
NicoPennec
1.4k
NicoPennec
commented 12 days ago

Hi @Jered
Thanks for your request ๐Ÿ‘

Can you create and share a simple Nuxt project to reproduce the payload issue, please?
This will help to test a fix.

0
Informations
Feature Request โ€ข Open
#c52 - Created 3 months ago