nuxt-community / sitemap-module

Sitemap Module for Nuxt 2
https://sitemap.nuxtjs.org
MIT License
685 stars 129 forks source link

Dynamically generated routes are not excluded #288

Closed madiyetov closed 11 months ago

madiyetov commented 1 year ago

Description

If we pass exclude property with glob pattern for dynamically generated routes, it's not applied:

export default {
   sitemap: {
      exclude: ['**/dynamic-route']
   }
}

In this line, the pattern from exclude is applied inside staticRoutes to static routes, but routes coming from promisifyRoute(options.routes) are not filtered.

nuxt@2.17.0

NicoPennec commented 1 year ago

Hi @madiyetov,

As explained in the documentation of exclude property, it's only to exclude routes from staticRoutes, before caching data (see here)

if you need to exclude some dynamics routes, you have to customize your routes function or use the filter function.