How to add lastmodISO with non-dynamic routes?

antimodern
0
antimodern
commented 4 months ago

Docs covering mostly dynamic routes. I am using default settings, since I have siple website without API. So how do I add lastmodISO etc to sitemap then? It just list links by default.

0
NicoPennec
1.4k
NicoPennec
commented 4 months ago

For now, you can use the "filter" function to create your own custom filter to extend any static or dynamic routes.

see doc: https://github.com/nuxt-community/sitemap-module/blob/master/README.md#filter

a simple example:

  sitemap: {
    filter: ({ routes }) =>
      routes.map(route => ({
        ...route,
        lastmodISO: new Date().toISOString(),
        priority: 1

      })),
  }
0
Informations
Question โ€ข Unresolved
#c43 - Created 4 months ago